I have a custom condition with the id of "uri", as on some parts of our site we needed to set context rules based on the uri.

 * @Condition(
 *   id = "uri",
 *   label = @Translation("URI"),
 * )

As a result when I go to create or edit an existing container, when I hit save I'm hitting an error as there is some logic in ContainerTrait.php that assumes we are on the google tag settings form purely on the assumption that a field with the name "uri" isn't null.

However as the ContainerForm uses conditionsForm() to build dynamic conditions, this now adds a "uri" field. This obviously isn't the uri field the settings form is expected, and therefore errors occur.

Adding an extra check to make sure we are saving a form with the id google_tag_settings before loading and using the uri field should resolve this.

Comments

ThomWilhelm created an issue. See original summary.

thomwilhelm’s picture

Title: Have a condition with the id 'uri' breaks » Have a condition with the id 'uri' breaks the container form.
thomwilhelm’s picture

StatusFileSize
new2.41 KB
thomwilhelm’s picture

Status: Active » Needs review
thomwilhelm’s picture

Title: Have a condition with the id 'uri' breaks the container form. » Having a condition with the id 'uri' breaks the container form.
solotandem’s picture

Title: Having a condition with the id 'uri' breaks the container form. » Allow for a 'uri' condition in the container form
Category: Bug report » Feature request

Thanks for reporting this. Changing category as one can argue the name clash is as much a 'bug' on your end; let's consider this a feature request.

  • solotandem committed 6e50272 on 8.x-1.x
    Issue #3115753 by ThomWilhelm, solotandem Allow for a 'uri' condition in...
solotandem’s picture

Status: Needs review » Fixed

Above commit implements proposed resolution.

thomwilhelm’s picture

Thanks @solotandem much appreciated :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.