- 🇪🇸Spain dtamajon
Hi, I'm interested in that feature but trying to figure out how to add custom conditions from a custom module, as I need to add conditions based on my custom fields.
Do I have to follow some base class as in Rules module?
- 🇵🇹Portugal joao.ramos.costa
Hi @dtamajon you can create a class that extends ConditionPluginBase.
Have a look https://drupalsun.com/2021/04/29/condition-plugins-visibility-drupal-8-9 . Cheers - 🇪🇸Spain dtamajon
I tried to add conditions successfully (custom ones and default ones) but on saving a node the alias is generated without calling any 'evaluate' function from any Condition.
Am I missing something?
- Open on Drupal.org →Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7last update
about 1 year ago Not currently mergeable. - 🇧🇪Belgium dieterholvoet Brussels
I had to fix a couple things to make it work on Drupal 10, but apart from that this feature seems to be working! @Berdir, could you comment on whether or not this feature should live in a submodule? That way we know how to move this forward. Since this feature has lived in this MR for two years already and it seems to be working great, I'm considering creating a new project for the submodule so that people can start using it.
- 🇳🇱Netherlands uberengineer
Patch #20 does not apply due to whitespace #21 applies
- First commit to issue fork.
- Open on Drupal.org →Core: 10.2.x + Environment: PHP 8.1 & MySQL 5.7last update
8 months ago Not currently mergeable. - last update
8 months ago 27 pass, 4 fail - last update
8 months ago 27 pass, 4 fail - 🇦🇺Australia max.valetov
Adds a D10 session check and set for subrequest to patch 21
- 🇺🇸United States bkosborne New Jersey, USA
This is fantastic! Thanks for working on this. I may have time to contribute as well.
One change I think this needs is to disable the default, hard-coded conditions UI that pathauto already provides for specifying language and content type. I think that if this sub-module is used, then all conditions should be managed by it.
- 🇺🇸United States bkosborne New Jersey, USA
Please, let's keep all work in the merge request. The last three patch files are especially problematic because they don't include an interdiff.
- last update
7 months ago 27 pass, 4 fail - last update
7 months ago 27 pass, 4 fail - last update
7 months ago 27 pass, 4 fail - last update
7 months ago 27 pass, 4 fail - 🇺🇸United States bkosborne New Jersey, USA
While this is working well, it exposes a problem with the PathautoWidget that sort of makes it useless with any conditions that rely on pulling data from the entity.
The form widget disables Pathauto if there isn't a matching pattern for the entity. The problem is that a pattern may not match an entity until the entity has been saved and has data.
Until now, the only conditions a pathauto pattern could have were entity bundle and language, both of which are known even before an entity is saved, so this wasn't a problem.
But now, with this, any type of condition can be added. For example, the Term Condition → module provides a condition plugin that evaluates if an entity has a specific term associated with it.
So, as a result, if you have a pattern with a "Page" content type condition and TermCondition for some taxonomy term "Term A", when you go to create a new Page node, the Pathauto checkbox won't be there and it won't be activated. If you save the node with a "Term A" reference, the pattern won't be activated. If you edit the node and save it again, it will be activated and the alias will be generated.
To be clear, the conditions UI that this patch provides is working as expected, it just exposes some additional challenges with Pathauto.
- last update
7 months ago 48 pass - 🇧🇪Belgium dieterholvoet Brussels
There seems to be an issue since the changes that were done in the past months: when updating an existing condition, it's being duplicated instead of the existing one being updated.