View Issue Details

IDProjectCategoryView StatusLast Update
0000318Adventure PHP FrameworkBugpublic2017-08-06 22:22
ReporterChristianAchatzAssigned ToChristianAchatz 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.3 
Target Version3.4Fixed in Version3.4 
Summary0000318: Listener tags not notified in case of multiple listeners
DescriptionActual behavior:
----------------
In case a form features multiple form validation listener tags, only the last listener is notifier to display form control specific error messages.

Expected behavior:
------------------
All validation listeners are notified.
Steps To ReproduceForm:
=====

<@controller class="test\pres\controller\TestController"@>

<html:form name="test">
    <form:text name="test1"/><form:listener control="test1">Test1</form:listener>
    

    <form:text name="test2"/><form:listener control="test2">Test2</form:listener>
    

    <form:addvalidator class="APF\tools\form\validator\TextLengthValidator" button="send" control="test1|test2"/>
    <form:button name="send" value="GO"/>
</html:form>


Controller:
===========

namespace test\pres\controller;

use APF\core\pagecontroller\BaseDocumentController;

class TestController extends BaseDocumentController {
    public function transformContent() {
        $form = $this->getForm('test');
        $form->isValid();
        $form->transformOnPlace();
    }
}
TagsNo tags attached.
Codereferenz: ([Datei]:[Zeile])
Namespacetools

Activities

ChristianAchatz

2017-07-24 21:39

administrator   ~0000771

Reasoning:
----------

Validation listener 1 has never been notified due to the fact that form validation (recursive calling of isValid() on all form controls) has been omitted for any further form control in case one form control has assumed invalid state. This not only affected validation listeners but also form control marking (CSS class).


Fix:
----

Along with fixing the logic glitch in HtmlFormTag the reference operators in FormValidator and FormFilter have been removed to fix the reference issue leading to only the last validation listener has been notified.

ChristianAchatz

2017-07-24 21:51

administrator   ~0000772

Fix pushed under https://github.com/AdventurePHP/code/commit/99dd8b1f5d7bd2ae47817031e15eb57fa4378f5d.

Documentation update and change log entry required.

ChristianAchatz

2017-07-25 22:08

administrator   ~0000773

Added further unit tests to ensure validator is created correctly.

ChristianAchatz

2017-08-06 22:22

administrator   ~0000774

Completed documentation work. Closing issue.

Issue History

Date Modified Username Field Change
2017-07-24 21:19 ChristianAchatz New Issue
2017-07-24 21:19 ChristianAchatz Status new => assigned
2017-07-24 21:19 ChristianAchatz Assigned To => ChristianAchatz
2017-07-24 21:39 ChristianAchatz Note Added: 0000771
2017-07-24 21:51 ChristianAchatz Note Added: 0000772
2017-07-25 22:08 ChristianAchatz Note Added: 0000773
2017-08-06 22:22 ChristianAchatz Note Added: 0000774
2017-08-06 22:22 ChristianAchatz Status assigned => resolved
2017-08-06 22:22 ChristianAchatz Fixed in Version => 3.4
2017-08-06 22:22 ChristianAchatz Resolution open => fixed