The present article describes the changes, that have to be applied to your software upgrading to release 1.11. This is necessary because the new version contains API chnages.
The changes concerning the new form taglibs are surely the biggest part of the migration. Here, controller and templates must be adapted to the new structure.
Within the controller classes, the API change of the html_taglib_form taglib concerning the status query must be adapted. This can be done by replacing
get('isSent')get('isValid')isSent()isValid()Adapting the templates includes extraction of the validator and filter definition into separate tags. For this reason, the developer must decide, which validator should be used instead of the old one. The subsequent list contains a suggestion:
After that, the validator definition must be extracted from the taglib statement. Instead of the old notation
<form:text
name="sender-address"
validate="true"
validator="EMail"
button="send"
/>you now have to add
<form:text name="sender-name" />
<form:addvalidator
class="EMailValidator"
button="send"
control="sender-name"
/>The migration of the form filter is similar. Here, the integrated filter definitions must be put into seperate filter tags. In case a text field is secured by
<form:text
name="sender-name"
button="send"
filter="stripTags"
/>using the stripTags filter, the taglib definition now must look like this:
<form:text name="sender-name" />
<form:addfilter
class="StripTagsFilter"
button="send"
control="sender-name"
/>The following list contains a suggestions for the migration of the filter classes:
Die to the fact, that the validator group (<form:genericval >) and the generic validator tag <form:genericval /> hav been removed from the release, validation messages displayed within a dedicated boy must be implemented in some different way.
To achieve this, the <form:error /> and <form:listener /> can be used. The latter one can be instructed to display the border of the box and several listener tags display the dedicated error messages. Instead of
<form:valgroup name="FormValGroup">
<div class="form-error">
<img src="/img/form-error.png" alt=""/>Fehler:
<ul>
<li><valgroup:validate type="text" field="AbsenderName" button="KontaktSenden" msginputreq="Contact.Sender.InputRequired" /></li>
<li><valgroup:validate type="text" field="AbsenderAdresse" button="KontaktSenden" msginputreq="Contact.EMail.InputRequired" msginputwrg="Contact.EMail.InputWrong" validator="EMail" /></li>
<li><valgroup:validate type="text" field="Betreff" button="KontaktSenden" msginputreq="Contact.Subject.InputRequired" /></li>
<li><valgroup:validate type="text" field="Text" button="KontaktSenden" msginputreq="Contact.Text.InputRequired" /></li>
</ul>
</div>
</form:valgroup>you may use the following tag syntax:
<form:error id="toperror">
<div class="form-error">
<img src="/img/form-error.png" alt=""/>Fehler:
<ul>
</form:error>
<form:listener control="AbsenderName" id="sender-error">
<li><listener:placeholder name="content" /></li>
</form:listener>
<form:listener control="AbsenderAdresse" id="addr-error">
<li><listener:placeholder name="content" /></li>
</form:listener>
<form:listener control="Betreff" id="subject-error">
<li><listener:placeholder name="content" /></li>
</form:listener>
<form:listener control="Text" id="text-error">
<li><listener:placeholder name="content" /></li>
</form:listener>
<form:error id="bottomerror">
</ul>
</div>
</form:error>Just like in release 1.10, some classes were renamed to conform to the APF coding conventions. To upgrade to the new version, search&replace them as stated below:
This release also contains configuration changes to the following components:
JetBRAINS supports the development of the APF with PHPStorm licenses and we feel confidential that PHPStorm strongly influences the APF's quality. Use PHPStorm!
Proud to useIntelligent PHP IDE for coding, testing and debugging with pleasure