Allow filtering between "Section" & "Template" within offcanvas & modal screen

Created on 27 January 2021, almost 4 years ago
Updated 30 April 2024, 7 months ago

Problem/Motivation

Would like the ability to filter our imported sections/templates via the offcanvas dialog or modal screens.

Steps to reproduce

  • Click "Import section from Library" or the new button at the bottom of Layout Builder pages "Import template from library"

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada AaronChristian Kelowna, BC

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States jastraat

    I'm attaching a patch that integrates the MR's changes with the latest dev of section_library. Unfortunately I could not make changes to the MR directly. This also does not resolve the two last issues.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 7 months ago
    2 fail
  • πŸ‡ΊπŸ‡ΈUnited States jastraat

    Updated patch that pre-filters template type based on the import link clicked. Still haven't figured out how to get the ajax modal to close after adding a template.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update 7 months ago
    1 pass
  • Status changed to Needs review 7 months ago
  • Open on Drupal.org β†’
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 8
    last update 7 months ago
    Waiting for branch to pass
  • πŸ‡ΊπŸ‡ΈUnited States jastraat

    And finally figured out the dialog closing issue. This latest patch addresses both of the outstanding issues mentioned in #3.

  • Open on Drupal.org β†’
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 8
    last update 7 months ago
    Waiting for branch to pass
  • πŸ‡ΊπŸ‡ΈUnited States jastraat

    Sorry - that earlier patch included some changes from another section_library patch I have applied.
    Here's a clean one.

  • Status changed to Needs work 6 months ago
  • πŸ‡¨πŸ‡¦Canada AaronChristian Kelowna, BC

    Thanks @jastraat for picking this up so long after the creation of this issue!

    I did try to test the patch but received some errors in doing so;

    TypeError: Drupal\section_library\Form\AddSectionToLibraryForm::__construct(): Argument #4 ($module_handler) must be of type Drupal\Core\Extension\ModuleHandler, Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given, called in /var/www/web/modules/contrib/section_library/src/Form/AddSectionToLibraryForm.php on line 99 in Drupal\section_library\Form\AddSectionToLibraryForm->__construct() (line 88 of /var/www/web/modules/contrib/section_library/src/Form/AddSectionToLibraryForm.php).
    

    Wondering if maybe there is still some of the other patch being caught up in the mix here.

    I also tried to apply patch #5 but got this error;

    TypeError: Drupal\section_library\Form\AddSectionToLibraryForm::__construct(): Argument #4 ($module_handler) must be of type Drupal\Core\Extension\ModuleHandler, Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given, called in /var/www/web/modules/contrib/section_library/src/Form/AddSectionToLibraryForm.php on line 99 in Drupal\section_library\Form\AddSectionToLibraryForm->__construct() (line 88 of /var/www/web/modules/contrib/section_library/src/Form/AddSectionToLibraryForm.php).
    

    Going to mark this as "Needs work" for the time being.

    If you manage to sort things out feel free to post back and I'll give it another test.

    Thanks again!!!

  • πŸ‡ΊπŸ‡ΈUnited States jastraat

    Hey @AaronChristian thank you for testing! Just to make sure, did you fully clear the Drupal cache after applying the patch? This injects a new service to check for layout_builder_modal.

  • πŸ‡ΊπŸ‡ΈUnited States dmundra Eugene, OR

    @jastraat would the patch benefit from a update hook to clear the cache?

  • Status changed to Needs review 6 months ago
  • Open on Drupal.org β†’
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 8
    last update 6 months ago
    Waiting for branch to pass
  • πŸ‡ΊπŸ‡ΈUnited States jastraat

    Adding a patch with a post-update hook to automatically clear the cache and pick up the updated form dependencies.

  • πŸ‡ΊπŸ‡ΈUnited States jastraat

    I'm afraid my last few patches were corrupted. Here's a new patch with the changes from patch 7 + a post update hook to clear the cache and prevent the error @AaronChristian saw.

  • Merge request !30Resolve #3195007 "Allow filter by type" β†’ (Closed) created by jastraat
  • πŸ‡ΊπŸ‡ΈUnited States jastraat
Production build 0.71.5 2024