Forums / Developer / Custom ezxmltext/tags do not unset variables - overriding next tags

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Custom ezxmltext/tags do not unset variables - overriding next tags

Author Message

Plamen Petkov

Sunday 04 April 2004 11:50:09 am

If using the SAME <custom> tag (with custom attributes) more than 1 time in a xml text field, custom attributes are not unset. This way, the FIRST ONE's <custom> tag attributes are used in the next tag (with same "name") IF !! the next tag has NO the corresponding attribute set (kind of "default" attributes behaviour, set by the first tag).

Adding this (+) piece of code in

kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php (~ line 562) :

                $textElements = array();
                eZTemplateIncludeFunction::handleInclude( $textElements, $uri, $tpl, 'foo', 'xmltagns' );
+		reset($customAttributes);
+                foreach ( $customAttributes as $attribute )
+                {
+		    $tpl->unsetVariable( $attribute->Name, 'xmltagns' );
+                }
            }

solves the problem (is this a problem ?)

regards
plamendp