- First commit to issue fork.
- @codebymikey opened merge request.
Rerolled existing patch targeting the latest dev (and supporting Drupal 10).
- ๐บ๐ธUnited States webdrips
The patch from #31 still has the same issue I reported in #25 unfortunately.
Here is the full stack trace:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "entity_field_condition.subform.helper_factory". in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php). Drupal\entity_field_condition\Plugin\Condition\FieldValue::create() (Line: 21) Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 59) Drupal\Core\Condition\ConditionManager->createInstance() (Line: 72) Drupal\layout_builder\EventSubscriber\SectionComponentVisibility->onBuildRender() call_user_func() (Line: 142) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 117) Drupal\layout_builder\SectionComponent->toRenderArray() (Line: 88) Drupal\layout_builder\Section->toRenderArray() (Line: 316) Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildSections() (Line: 275) Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple() (Line: 340) Drupal\Core\Entity\EntityViewBuilder->buildComponents() (Line: 24) Drupal\node\NodeViewBuilder->buildComponents() (Line: 282) Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (Line: 239) Drupal\Core\Entity\EntityViewBuilder->build() call_user_func_array() (Line: 101) Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 788) Drupal\Core\Render\Renderer->doCallback() (Line: 374) Drupal\Core\Render\Renderer->doRender() (Line: 204) Drupal\Core\Render\Renderer->render() (Line: 242) Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 243) Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 132) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() call_user_func() (Line: 142) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 174) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50) Drupal\ban\BanMiddleware->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23) Stack\StackedHttpKernel->handle() (Line: 718) Drupal\Core\DrupalKernel->handle() (Line: 19)
Now using Drupal 9.5.9 and the EFC 8.1.4
I didn't need to do anything to get this error this time except view a page on the site.
We are using this in conjunction with the Layout Builder to show various views/fields based on field conditions (e.g. a taxonomy value).
- ๐บ๐ธUnited States webdrips
Patch #35 kicks out an error:
ParseError: syntax error, unexpected identifier "parent", expecting ";" in Composer\Autoload\includeFile() (line 443 of modules/contrib/entity_field_condition/src/Plugin/Condition/FieldValue.php).
Just an FYI, regarding #25, the reason Layout Builder context integration broke in D10 is referenced in #2916876-192: Add visibility control conditions to blocks within Layout Builder โ
- ๐จ๐ฆCanada liquidcms
Anyone know the status of this?
We had it working on D9.5 but it does not work for D10. I see the patch has code which references: \Drupal\entity_field_condition\Subform\SubformHelperFactoryInterface but this doesnt exist in the 1.x or 2.x branches.
- ๐จ๐ฆCanada liquidcms
Not sure what #35 patch is as it refers to code which doesn't exist. To get this working for D10 i took the version i was using in D9 (1.3) and the patch i was using from here (#19) and simply made it D10 compatible by removing the composer.json file and setting core_version_requirement.
Not quite the proper path forward i suspect but unclear the direction here.
- ๐จ๐ฆCanada joseph.olstad
joseph.olstad โ made their first commit to this issueโs fork.
- @josepholstad opened merge request.
- ๐จ๐ฆCanada joseph.olstad
Ok I scrapped my own merge request.
Try this patch instead
- Status changed to Needs review
about 1 year ago 8:54pm 11 November 2023 - ๐จ๐ฆCanada joseph.olstad
patch 43 removes the garbage .orig file and I tried to do a better job dealing with conflicts than patch #35
With that said, I am still reviewing the patch
- ๐จ๐ฆCanada joseph.olstad
Patch 43 resolves the issues that I noticed with patch #35
Please review
- ๐จ๐ฆCanada joseph.olstad
Thanks to @liquidcms for reporting the success with patch #19 on Drupal 10 using a modified version of release 1.3.
I took this as proof that patch #19 works well.
So I re-rolled patch #19 on top of 8.x-1.x head of dev to create #43. The conflicts were carefully resolved and I believe the re-roll is a path forward here.
- ๐บ๐ธUnited States webdrips
#43 (and #19) no longer seem to work for me on Drupal 10 sites (10.1.5 or 10.1.6). I can't edit an existing field condition for visibility controls nor add a new one.
In both cases, I get
"error: context "entity" is missing."
with an "Update" button that does nothing and a "Back" link.Steps to reproduce on an existing block with an existing rule:
- Click the context menu and select "control visibility"
- Click Edit
"error: context "entity" is missing."
On a new block or one without a visibility condition:
- Add the block to the layout builder
- Context menu > control visibility
- Select Field Value and click Add condition
"error: context "entity" is missing."
The field in question is a list (text) field.
Updated the default "Node Field (without preview)" condition so it's a bit more robust - such that the AJAX callbacks now works regardless of where it's used from e.g. Layout Builder and Blocks.
Also added a new
equals
andregex
operation, making thecontains
operation now more of astr_contains()
check instead of a regex.- ๐บ๐ธUnited States kevinquillen
@codebymikey does the patch in #48 fix the issue here as well?
https://www.drupal.org/project/entity_field_condition/issues/3278442#com... ๐ fields of bundle are not loaded when using Context UI Needs review
- ๐จ๐ฆCanada darkodev
I tested MR5 in the following forms and it works. Thanks very much for getting this far with this!
Layout Builder (my original need for this patch along with the block visibility patches in https://www.drupal.org/project/drupal/issues/2916876 โจ Add visibility control conditions to blocks within Layout Builder Needs work ).
Works as expected, but throws an AJAX error after choosing the node type. In spite of the console error, it does load the fields and allows saving of the condition, which then works as expected.Core Block Layout
Works as expected.Menu Position
This module used to ship with a field value option in D7, which no longer exists in D10.
Works as expected.I do not use Context module.