🇬🇧United Kingdom @mjmorley

Account created on 21 September 2020, over 3 years ago
#

Recent comments

🇬🇧United Kingdom mjmorley

Added a patch here to update the hook update number so it applies to 2.4.x

🇬🇧United Kingdom mjmorley

Having a nightmare here. The last patches didn't have the new custom entity reference selection on.
These two patches should.

🇬🇧United Kingdom mjmorley

The last patches were erroneous so here are the patches again but with the fixes in the entity annotation

🇬🇧United Kingdom mjmorley

Here is the patch that omits the form_alter

🇬🇧United Kingdom mjmorley

I've been working on this to try and get a nice solution, it feels like much better UX.

I think the best solution here would be to set the target bundles in the form alter from a paragraph. In the $context variable we can get the target bundles of the parent field, and then set them on the #selection_settings of field_reusable_paragraph.

This does mean in LibraryItemSelection::buildEntityQuery we can't call parent::buildEntityQuery as it will throw errors. For now in the patch I have just copied relevant code from the parent function, but I guess an alternative would be to store the target bundles in a different field and then use them from there. But it seems clunkier to me.

I have added one patch that has the form_alter built into the paragraphs_library module. I will also add another comment below with a patch that omits the form alter, so people can add their own form alter implementation if they wish.

🇬🇧United Kingdom mjmorley

This is a duplicate of https://www.drupal.org/project/quick_node_clone/issues/3306677 Intercompatibility with Group module new versions Needs work .
Patch #5 from that issue fixes the problem and I think is a nicer solution than the one here in this issue. I think there needs to be some discussion about which approach is better and to close the relevant ticket.

🇬🇧United Kingdom mjmorley

In Drupal 10 the method getMasterRequest on the RequestStack is gone and we should just use getMainRequest. I have updated patch #9 to reflect this, as patch #10 failed some tests.

This new patch should be compatible with D10.

🇬🇧United Kingdom mjmorley

Second patch, as I realised the first one was erroneous

Production build 0.69.0 2024