adrian

Module Toolkit

Recommended Posts

 
It allows bulk automated migration installation and upgrading of modules (and their config settings) from one PW install to another, so it should be very handy in setting up new sites with your standard collection of favorite modules and settings. Allows includes batch installing by a list of module class names.
 

Go to the Setup > Module Toolkit and follow the prompts.

  • During the import, you can choose which modules from the collection to import.
     
  • You can optionally import the module config settings from the source install. The one caveat is if a particular setting includes a reference to a page, template, or field ID, it won't work, but you can easily update this setting on the destination install.
     
  • Batch install new modules directly from the modules directory with a list of module classnames or URLs to module zip files.
     
  • You can optionally, automatically update all of the imported modules (if they are in the ProcessWire modules directory) to their latest available versions.
     
  • It copies the module files so you can use it to migrate modules that are not available in the PW modules directory, or on Github. Great for all those custom helper modules you've created.
     
  • Full restore feature in case something goes wrong / you change your mind.

I maintain a dedicated test PW install for installing and configuring modules which I can then export for use in my projects using this tool.

Please test and let me know what you think!

  • Like 26

Share this post


Link to post
Share on other sites

Hi everyone,

Just added some new features (not in the repo just yet), but wanted to get some feedback on a new name for the module. It still functions as a way to migrate modules and their settings from one PW install to another, but now also includes:

  • batch download and install modules from a list of class names entered in a textarea field
  • batch module updating

Name ideas:

  • ModulesManager wouldn't be bad, but already taken :)
  • ModulesMigratorInstallerUpdater would be the most accurate, but obviously ugly
  • ModulesInstaller is OK, but doesn't cover everything
  • ModulesHelper ?
  • ModulesToolkit ?

Free like for any suggestions :)

Here are some screenshots for inspiration:

THE OPTIONS

post-985-0-24582300-1428940364_thumb.png

EXPORTING

post-985-0-80474300-1428940186_thumb.png

INSTALLING (FROM MIGRATED ZIP)

post-985-0-29425300-1428940200_thumb.png

post-985-0-79357000-1428940209_thumb.png

INSTALLING (FROM LIST OF CLASSNAMES)

post-985-0-01165600-1428940221_thumb.png

post-985-0-02950600-1428940229_thumb.png

BATCH UPDATING MODULES WITH AVAILABLE UPDATES

post-985-0-07304000-1428940310_thumb.png

post-985-0-18361300-1428940318_thumb.png

  • Like 7

Share this post


Link to post
Share on other sites

ModuleToolkit is not tha bad..

other tags could be:

ModuleDirector

ModuleAdmin

ModuleMigratorExtended

looks really great for speed up site setup with the new tools!!

Best regads

mr-fan

  • Like 1

Share this post


Link to post
Share on other sites
looks really great for speed up site setup with the new tools!!

Yep - speedier site setup for sure!

Also, with the new batch update function, it is also much easier to update all the modules on existing sites in one go. I find it can be quite tedious to update modules one by one with the current PW tools.

  • Like 1

Share this post


Link to post
Share on other sites

Ok, module has been renamed to Module Toolkit and can now be considered in beta.

In addition to the new functionality noted in the second post, there has been lots of cleanup and one new feature - if you are also running Ryan's ProcessWireUpgrade module, there will be a new button on that module called "Batch Upgrade Modules" that will bring you directly to this module's Upgrade page where you can confirm which modules to upgrade and do them all with one click!

I know that there likely is still some needed improvements in error checking and reporting, but otherwise I think all functionality is working well!

If you have a chance please test and let me know of any issues you come across.

  • Like 7

Share this post


Link to post
Share on other sites

This looks like a great timesaver! Thanks for creating this module. I will try it next week.

One minor feature I would like to see added: As I often use forks of modules or custom modules or which are not in the modules directory it would be great if the "list of modules to install" could also contain links to zip files. But also without this addition I think this module will be my new favorite way to install modules when setting up a new site.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks @interrobang,

I have just committed an updated that takes care of your request. Now you can enter a mix of module class names for modules in the PW modules directory and URLs to module zip files for any modules only on Github or elsewhere.

Should be a great addition.

  • Like 4

Share this post


Link to post
Share on other sites

Yesterday I thought exactly about this procedure. I use several modules over and over again. And it's a hassle to download always the same modules, even when it's comfortable with ModulesManager.

Now I don't have to think further, because you already did it! Great work, and obvious a real time time saver. So it fits perfectly in the ProcessWire galaxy! :)

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

I just added an "Upgrade Cleanup" option. Now you can easily cleanup all of the backups from the ProcessWire Upgrade module. It lets you review all the folders/files tagged for deletion and then deletes all with one click. It covers core wire folders, .htaccess and index.php backups, as well as all site module backups.

I am also hoping to do some thorough testing of the entire module and get it ready for release fairly soon - is anyone out there using it regularly? Any comments/suggestions/issues?

PS If you're not already using the PW Upgrade module be sure to make it one of your defaults to install on every site - it handles PW core and 3rd party site modules.

  • Like 6

Share this post


Link to post
Share on other sites
5 hours ago, Ivan Gretsky said:

Good day, @adrian!

Is there anything preventing you from publishing this one in module directory? I only found it 'cuz I knew where to look for ;).

There are still some unsolved issues when installing (or maybe it's exporting?) a module which has required or requiredby dependencies. To be honest it's been a while since I looked at this. I would like to revisit it because it has the potential to be a huge timesaver. I am also thinking of implementing this functionality (https://processwire.com/talk/topic/14117-module-settings-import-export/) into it.

If I can make some time for it, I'll see what I can do about sorting out these issues and getting it published.

  • Like 3

Share this post


Link to post
Share on other sites

@adrian Do you plan to extend the batch install module to include built-in modules? I just installed about 10 modules from the modules directory which saved me a lot of time. Being able to install built-in modules like AdminThemeReno, LanguageSupportPageNames, LanguageTabs etc would be great.

  • Like 1

Share this post


Link to post
Share on other sites
On 1/9/2017 at 8:33 AM, tpr said:

@adrian Do you plan to extend the batch install module to include built-in modules? I just installed about 10 modules from the modules directory which saved me a lot of time. Being able to install built-in modules like AdminThemeReno, LanguageSupportPageNames, LanguageTabs etc would be great.

I don't see why not - I never really thought about it before, that's all.

Trouble is that I now have too many modules and not enough time :)

I wasn't really sure how much use this module was getting. Is anybody else using this regularly?

 

  • Like 2

Share this post


Link to post
Share on other sites

Just a heads up that I have committed a new version with lots of bug fixes (although I expect there are still some more to come). Also, there was a spelling mistake in the class name of the old version (as noted by @tpr above), so you should uninstall the old version and install this new version from scratch.

Would like to get an idea of how many people are using this - I'd like to get it working well, but it's already been a substantial effort and want to make sure this is in demand over the Module Settings Import / Export that I released yesterday. Obviously this is way more powerful, but maybe it's more than most people want.

Thanks for any feedback.

Cheers,
Adrian

  • Like 2

Share this post


Link to post
Share on other sites
On 1/9/2017 at 8:33 AM, tpr said:

@adrian Do you plan to extend the batch install module to include built-in modules? I just installed about 10 modules from the modules directory which saved me a lot of time. Being able to install built-in modules like AdminThemeReno, LanguageSupportPageNames, LanguageTabs etc would be great.

I just tested this using the "Text List" and "JSON settings" options and it should now work with Core modules as well, but it's not well tested, so please let me know how it goes.

  • Like 2

Share this post


Link to post
Share on other sites

I've just used the JSON with settings feature to install 3rd party and some core modules, worked well. It's nice to see how much time this module can save, thanks!

First I thought core and 3rd party modules are mixed but 3rd party ones were at the end of the checkboxes list, apart from one or two. If they could be separated better it would be great, eg. in two columns or making 3rd party ones bold or something.

Another thing I noticed is that when the batch install reached a module not listed in the Modules Directory (nor available on GitHub) the batch was aborted and the rest of the modules weren't installed. This was a custom module. If it was possible to skip these and continue with others that would be great.

  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, tpr said:

Another thing I noticed is that when the batch install reached a module not listed in the Modules Directory (nor available on GitHub) the batch was aborted and the rest of the modules weren't installed. This was a custom module. If it was possible to skip these and continue with others that would be great.

@tpr there seems to be an option to collect those too:

Quote

It copies the module files so you can use it to migrate modules that are not available in the PW modules directory, or on Github. Great for all those custom helper modules you've created.

 

Share this post


Link to post
Share on other sites

That's true for the "zip download" export option, but for the "JSON list" obviously it's not. If custom modules were skipped that would have been more "user-friendly" than aborting. I'll use the ZIP option next time though, thanks for the info.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Macrura
      Field Descriptions Extended
      This module enables you to extend field descriptions by dividing short descriptions with a longer text that is revealed in a toggle.
      Github: https://github.com/outflux3/FieldDescriptionsExtended
      Extending your field descriptions using the standard field's description field.
      Once this module is installed, it will automatically search your description field for the presence of 5 dashes (-----).
      Any content above the 5 dashes will be visible and the content below the dashes will be hidden. A 'More...' link will appear at the end of the short description which when clicked will reveal the rest of the description.
      Using Simple Markdown Editor with the description field
      If you have Simple Markdown Editor (InputfieldSimpleMDE) installed, you can enable the field description to have that editor.
      *When using Simple MDE, you can use the button (Insert Horizontal Line) instead of typing 5 dashes. More about SimpleMDE.
      Extending your field descriptions using content from a ProcessWire Page for the field description.
      You may use the content from a ProcessWire page as a field description. This would allow you to easily insert images, links, and use hanna codes.
      To use page content for your field descriptions, please follow these instructions:
      Install Select Fields module (FieldtypeFields) http://modules.processwire.com/modules/fieldtype-fields/ Create a new field using this field type, e.g. field_select. Add the field to any template you will be using for your field descriptions. Setup your help pages (for example under a settings branch) where you will store the field description content,using the template containing the Field Select. Add content to a page and select the field where that content should show. To show a short text before the link to the longer content, separate them with 5 dashes Be sure to update your settings on this page, first enable page content descriptions,then specify the name of the Select Fields field, template to search, and content field. If you create a field description using this method, please note that the description field must be blank for contexts where you want the page content to appear.
      You can freely use template context for field descriptions, but the Page Content method is not context sensitive and will display under all contexts where the description is blank.
      ----
      original post:
      This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways.
      The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text.
      This is achieved by separating the intro/visible text and the rest with 5 dashes.

      Example setup:

      the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.

    • By netcarver
      Part 1 of a 2 part Module & Service Reveal.
      I'm currently working on a new module: ModuleReleaseNotes that was inspired by the work I originally did on making Ryan's ProcessWireUpgrades module "release" aware. In the end, I decided to ditch the approach I was originally taking and instead work on a module that hooked in to the UpgradeConfirmation dialog and the module edit page.
      Aims
      My aims for this module are as follows...
      Make discovery of a module's changes prior to an upgrade a trivial task. Make breaking changes very obvious. Make reading of a module's support documentation post-install a trivial task. Make module authors start to think about how they can improve the change discovery process for their modules. Make sure the display of information from the module support files/commit messages doesn't introduce a vulnerability. Looking at these in turn...
      Making discovery of a module's changes prior to upgrade a trivial task.
      This is done by adding a "What's changed section" to the upgrade confirmation dialog.  This section takes a best-effort approach to showing what's changed between the installed version and the updated version that's available via the module repository.
      At present, it is only able to talk to github-hosted repositories in order to ask them for the release notes, the changelog file (if present) and a list of commits between the git tag that matches the installed version and the tag matching the latest version.
      It will display the Release Notes (if the author is using the feature), else it will display the commits between the tags (if tagging is used by the module author) else it will show the changelog file (if present) else it will show the latest N commits on the master branch (N, of course, being configurable to your liking.)
      An example of the Github Release Notes pulled in for you, taken from Mike Rockett's TextformatterTypographer Module...

      An example of a tag-to-tag commit list from the same module...

      An example of a changelog - formatted to show just the changes (formatting styles will change)...

      Finally, an example of a fallback list of commits - sorry Adrian ...

       
      Making breaking changes obvious.
      This is currently done by searching for a set of configurable search strings. Later versions may be able to support breaking change detection via use of Semantic Versioning - but this may require some way of signalling the use of this versioning standard on a module-by-module basis.
      For now, then, you can customise the default set of change markers. Here I have added my own alias to the list of breaking change markers and the changes section of the changelog is styled accordingly (these will be improved)...

       
      Make reading of a module's support documentation, post-install, a trivial task.
      This is done by making some of the support files (like the README, CHANGELOG and LICENSE files) readable from the module's information/settings screen. There is an option to control the initial open/closed state of this section...

      Here is Tracy's README file from within the module settings page... 

       
      Make module authors start to think about how they can improve the change discovery process for their modules.
      There are notes in each of the sections displayed on the upgrade confirmation page that help authors use each of the features...

       
      Make sure display of external information doesn't introduce a vulnerability.
      This is an ongoing concern, and is the thing that is most likely to delay or prevent this module's release lead to this module's withdrawl should a vulnerability be found. Currently, output is formatted either via Markdown + HTML Purifier (if it was originally a Markdown file) or via htmlspecialchars() if it has come from a plaintext file.
      If you discover a vulnerability, please get in contact with me via the forum PM system.
       
      Ongoing...
      For now, I've concentrated on integration with GitHub, as most people use that platform to host their code. I know a few people are hosting their repositories with BitBucket (PWFoo comes to mind) and some with GitLab (Mike Rockett?) and I would eventually like to have adaptor implementations for these providers (and perhaps GitKraken) - but for now, GitHub rules and the other hosts are unsupported.
       
      Links
      Github: ModuleReleaseNotes
      PW Module Repository: Here (pending?)
    • By blynx
      Hej,
      A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated

      Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe
      .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip
      You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method:
      <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so:
      <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe
      What do you think? Any ideas, bugs, critique, requests?
      cheers
      Steffen
    • By mtwebit
      Tasker is a module to handle and execute long-running jobs in Processwire. It provides a simple API  to create tasks (stored as PW pages), to set and query their state (Active, Waiting, Suspended etc.), and to execute them via Cron, LazyCron or HTTP calls.
      Creating a task
      $task = wire('modules')->Tasker->createTask($class, $method, $page, 'Task title', $arguments); where $class and $method specify the function that performs the job, $page is the task's parent page and $arguments provide optional configuration for the task.
      Executing a task
      You need to activate a task first
      wire('modules')->Tasker->activateTask($task); then Tasker will automatically execute it using one of its schedulers: Unix cron, LazyCron or TaskerAdmin's REST API + JS client.
      Getting the job done
      Your method that performs the task looks like
      public function longTask($page, &$taskData, $params) { ... } where $taskData is a persistent storage and $params are run-time options for the task.
      Monitoring progress, management
      The TaskerAdmin module provides a Javascript-based front-end to list tasks, to change their state and to monitor their progress (using a JQuery progressbar and a debug log area). It also allows the on-line execution of tasks using periodic HTTP calls performed by Javascript.

       
      Monitoring task progress (and log messages if debug mode is active)

       
      Task data and log

      Detailed info (setup, task dependencies, time limits, REST API etc.) and examples can be found on GitHub.
      This is my first public PW module. I'm sure it needs improvement
       
    • By netcarver
      A very simple textformatter that was inspired by Diogo's RemoveHeight textformatter.
      This one strips the height from any images and either adds a custom class or adds a max-width:100% as an embedded style.
      Github: https://github.com/netcarver/TextformatterFluidImages
      PW Repo: To Be Confirmed.