- πΊπΈUnited States jrockowitz Brooklyn, NY
I am really sorry I missed this MR. I will try to review it in the next week or two. For now, let's leave it RTBC.
- Status changed to Needs work
about 2 years ago 1:05am 5 February 2023 - π§π·Brazil renatog Campinas
I saw a logic inside of hook_ENTITY_TYPE_load() using two conditions one per line, so it can be improved as described in the MR
- Status changed to Needs review
about 2 years ago 1:10am 5 February 2023 - last update
about 2 years ago 537 pass - Status changed to Needs work
almost 2 years ago 11:04am 28 May 2023 - πΊπΈUnited States jrockowitz Brooklyn, NY
Instead of using the current page as the source entity, this patch uses the associated block. Changing this behavior will cause major regressions for any site expecting a block's context to be the current page.
Personally, I would always want a webform block's context to the current page, unless I have multiple blocks with the same website on the same page.
We could allow webform blocks to define their context, current page, or block instance. The new configuration settings name could be 'context', and supported values would be 'page' or 'block'. The default context should be 'page', and the element's description can explain the differences and use cases.
- πΊπΈUnited States jrockowitz Brooklyn, NY
I wasn't familiar with context definitions, and it seems like the only solution to passing the block instance as the source entity to the webform instance.
@see https://www.drupal.org/node/3016699 β
@see https://www.drupal.org/docs/drupal-apis/plugin-api/plugin-contexts β
@see https://www.hashbangcode.com/article/drupal-10-creating-context-aware-pl... - πΊπΈUnited States jrockowitz Brooklyn, NY
I think paragraphs are facing a similar challenge with the current source entity, and maybe allowing site builders to change source entity context for webform fields could solve many problems.
- πΊπΈUnited States jrockowitz Brooklyn, NY
We have two similar solutions to the same problem.
π Webform block doesn't take into account source entity when caching Needs work
- πΊπΈUnited States inversed
Given that the problem mentioned in #14 is true - Paragraphs have a problem when duplicate webforms are embedded in a page and that is not specifically related to Blocks, do we need a different ticket for that? Multiple issues lead here but don't make it clear what the path forward is.
The chain of related tickets is a little confusing:
- This issue: [Webform block] Block redirect setting with node present collision
- #3301827 Webform confirmation message appears in first form when using multiple instances of same webform on a page π Webform confirmation message appears in first form when using multiple instances of same webform on a page Closed: duplicate (closed as duplicate)
- #2851419 Multiple webforms on single page β (closed as fixed but this could have been for different webforms on the same page)
- #3252331 [Webform block] Webform block doesn't take into account source entity when caching π Webform block doesn't take into account source entity when caching Needs work (given as a reference for one the issue)
- #2957002 Same webform multiple times on the same page β (closed as fixed but Paragraphs still have problems)