-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUGFIX] Prevent property spill-over to next call #419
Conversation
Pull Request Test Coverage Report for Build 1106
💛 - Coveralls |
@@ -88,6 +88,9 @@ public function initializeArguments() | |||
public function initialize() | |||
{ | |||
parent::initialize(); | |||
$this->tag->reset(); | |||
$this->tag->setTagName($this->tagName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this could be moved to setTagBuilder()
and drop the $this->tagName
injection from the constructor ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather, I'd remove the line that sets the tag name in setTagBuilder
since setter methods shouldn't mutate the object that is passed.
TagBuilders are already initialized with tag name as constructor argument ;)
In the future, tag based VH should become compilable in a way that TagBuilder is constructed outside and has one instance per execution, then passed to a static method that will render the tag. Then the TagBuilder reset and mutability can be reworked. Point being, if we aim for that then anything that treats the TagBuilder instance as a more stupid thing that needs init on every call, is imho a good thing. Even if it didn't also solve a bug ;)
@@ -88,6 +88,9 @@ public function initializeArguments() | |||
public function initialize() | |||
{ | |||
parent::initialize(); | |||
$this->tag->reset(); | |||
$this->tag->setTagName($this->tagName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather, I'd remove the line that sets the tag name in setTagBuilder
since setter methods shouldn't mutate the object that is passed.
TagBuilders are already initialized with tag name as constructor argument ;)
In the future, tag based VH should become compilable in a way that TagBuilder is constructed outside and has one instance per execution, then passed to a static method that will render the tag. Then the TagBuilder reset and mutability can be reworked. Point being, if we aim for that then anything that treats the TagBuilder instance as a more stupid thing that needs init on every call, is imho a good thing. Even if it didn't also solve a bug ;)
@NamelessCoder so are you fine with the change as is? |
This is okay with me. The one risk I see is someone overriding |
OK, fine with me. |
This particular Problem is fixed at the attribute "required" at inputfields but still is here at the attribute "checked" at radio buttons. All of my radiobuttons have this field "checked='checked'". As I think this is related to the same issue I will just post this here. Hmm.. after updating again to the latest fluidpages-master this issue is gone now.. sorry for this false alarm |
A regression has been detected as a consequence of this patch. TagBasedViewHelpers with Test case: public function testTagBasedViewHelperWithDataPrefixedArgument()
{
$invoker = new ViewHelperInvoker();
$viewHelper = new TagBasedTestViewHelper();
$arguments = [
'data-foo' => 'bar',
];
$result = $invoker->invoke($viewHelper, $arguments, new RenderingContextFixture());
$this->assertSame('<div data-foo="bar" />', $result);
} Test output:
|
Due to a regression in TYPO3#419, a TagBasedViewHelper which was called with one or more data- prefixed arguments would discard the prefixed arguments and the output would not contain the attribute. This patch fixes that regression by moving the handling of unregistered arguments to the initialize() function in order to make sure the additional attributes are handled *after* the reset() method has been called on TagBuilder. References: TYPO3#419
Due to a regression in TYPO3#419, a TagBasedViewHelper which was called with one or more data- prefixed arguments would discard the prefixed arguments and the output would not contain the attribute. This patch fixes that regression by moving the handling of unregistered arguments to the initialize() function in order to make sure the additional attributes are handled *after* the reset() method has been called on TagBuilder. References: TYPO3#419
Due to a regression in #419, a TagBasedViewHelper which was called with one or more data- prefixed arguments would discard the prefixed arguments and the output would not contain the attribute. This patch fixes that regression by moving the handling of unregistered arguments to the initialize() function in order to make sure the additional attributes are handled *after* the reset() method has been called on TagBuilder. References: #419
Due to a regression in TYPO3#419, a TagBasedViewHelper which was called with one or more data- prefixed arguments would discard the prefixed arguments and the output would not contain the attribute. This patch fixes that regression by moving the handling of unregistered arguments to the initialize() function in order to make sure the additional attributes are handled *after* the reset() method has been called on TagBuilder. References: TYPO3#419
We have found an issue where consecutive viewhelpers take over properties from the previous one.
This is the TYPO3 bug report: https://forge.typo3.org/issues/86890