Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update date_range_slider_facet.md #16

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

joshdentremont
Copy link
Contributor

removed notes on patching that are no longer needed. Added requirement of composer-installers-extender which allows composer to install to the libraries directory

removed notes on patching that are no longer needed. Added requirement of composer-installers-extender which allows composer to install to the libraries directory
@rosiel rosiel merged commit d873f12 into Islandora-Labs:main Aug 2, 2023
@rsauls
Copy link

rsauls commented Aug 15, 2023

Step #2 from the installation instructions on the Github page at https://github.com/Islandora-Labs/Islandora-Cookbook/blob/main/recipes/date_range_slider_facet.md are the following:

  1. Enable the modules (from the UI or from drush)
    • drush pm-enable facets controlled_access_terms jquery_ui_slider facets_range_widget (Note you may already have some or all of these modules included and enabled)
    When I ran that command I got this:

bash-5.1# drush pm-enable facets controlled_access_terms jquery_ui_slider facets_range_widget

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:

The service "islandora_drush_utils.missing_derivatives" has a dependency on a non-existent service "dgi_standard_derivative_examiner.examiner".

I was able to enable those modules via the web GUI (except for the facets rang widget, see below) but I have no idea what the above error message means when I tried from the command line.

@rsauls
Copy link

rsauls commented Aug 15, 2023

  1. Set up your composer.json to install the bower asset properly.

    Open the composer.json file in your drupal root in the editor of your choice.
    In the "repositories" section add

    {
    "type": "composer",
    "url": "https://asset-packagist.org/"
    }

    In the "installer-paths" section, you should have one for the libraries directory, but you'll need to extend to it. It should look like:

    "web/libraries/{$name}": ["type:drupal-library","vendor:npm-asset",
    "vendor:bower-asset"],

    In the "extra" section, add another section for installer types:

    "installer-types": ["npm-asset", "bower-asset"]

@rsauls
Copy link

rsauls commented Aug 15, 2023

  1. Add the required bower library for jquery-ui-slider-pips

    composer require bower-asset/jquery-ui-slider-pips
    If the step 3 was completed successfully and this command ran successfully, you should see in your web/libraries directory the jquery-ui-slider-pips directory has been created and populated. It may also have added jquery and jquery-ui folders depending on your existing install.

After modifying the composer.json as instructed above and running the command in step 4 it did NOT install the bower-asset/jquery-ui-slider-pips library into the /var/www/drupal/web/libraries directory. Instead, it put it in the /var/www/drupal/vendor directory. So when I then tried to enable the facets range widget it complained about the jquery-ui-slider-pips module was missing. So I then just moved the contents of /var/www/drupal/vendor/bower-asset/ to the /var/www/drupal/web/libraries directory and then I was able to enable the range widget module via the GUI.

@rsauls
Copy link

rsauls commented Aug 15, 2023

  1. Add the patch for facets to know where that library is

    Open up your composer.json again. In the extra section, you may have a "patches" section. If you do, add the patch from https://www.drupal.org/project/facets/issues/3186953 like so:

    "drupal/facets": {
    "slider fix": "https://www.drupal.org/files/issues/2020-12-14/3186953--7.patch"
    }

If you don't have a patches section at all, you can create one like so:

"patches": {
    "drupal/facets": {
        "slider fix": "https://www.drupal.org/files/issues/2020-12-14/3186953--7.patch"
    }
},

Install the patch by running composer update drupal/facets. You should see the output that it removes drupal/facets and then adds it back.

This is the error I got when trying to install the patch:

bash-5.1# composer update drupal/facets
Gathering patches for root package.
Removing package drupal/facets so that it can be re-installed and re-patched.

  • Removing drupal/facets (2.0.6)
    Deleting web/modules/contrib/facets - deleted
    Loading composer repositories with package information
    Updating dependencies
    Nothing to modify in lock file
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
    Gathering patches for root package.
    Gathering patches for dependencies. This might take a minute.
  • Installing drupal/facets (2.0.6): Extracting archive
  • Applying patches for drupal/facets
    https://www.drupal.org/files/issues/2020-12-14/3186953--7.patch (slider fix)
    Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-12-14/3186953--7.patch

@joshdentremont
Copy link
Contributor Author

@rsauls it looks like you might be looking at the old instructions from before this PR. Can you try the instructions at https://github.com/Islandora-Labs/Islandora-Cookbook/blob/main/recipes/date_range_slider_facet.md and see if it works for you? You shouldn't need the patches anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants