? Success

User tests: Successful: Unsuccessful:

avatar tranduyhung
tranduyhung
24 Nov 2015

In back-end, when we edit a component's configuration, if we validate a field by using JFormRule and the validation fails, the field's label and the custom error message are not displayed because the language files of the component are not loaded.

Please make this small change to see this problem.

  1. Open administrator/components/com_banners/config.xml
  2. Add validation="email" to purchase_type field, the result looks like this:

    <field
        id="purchase_type"
        name="purchase_type"
        type="list"
        label="COM_BANNERS_FIELD_PURCHASETYPE_LABEL"
        description="COM_BANNERS_FIELD_PURCHASETYPE_DESC"
        default="0"
        validate="email"
        >
    
  3. Edit Banners's configuration, save and you get this error message:

Invalid field: COM_BANNERS_FIELD_PURCHASETYPE_LABEL

  1. If you add message attribute for custom error message and use a language key which only exists in Banners component, like this

    <field
        id="purchase_type"
        name="purchase_type"
        type="list"
        label="COM_BANNERS_FIELD_PURCHASETYPE_LABEL"
        description="COM_BANNERS_FIELD_PURCHASETYPE_DESC"
        default="0"
        validate="email"
        message="COM_BANNERS_FIELD_PURCHASETYPE_DESC"
        >
    

    When you save the configuration, you get

Error
COM_BANNERS_FIELD_PURCHASETYPE_DESC

The problem is in validateField() of JForm (libraries/joomla/form/form.php), it doesn't load the language files of Banners component. This pull request is trying to do it.

Apply this commit, try again for the 2 cases above and you will get:

Invalid field: Purchase Type

Error
Select the type of purchase in the list.
avatar tranduyhung tranduyhung - open - 24 Nov 2015
avatar tranduyhung tranduyhung - change - 24 Nov 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Nov 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 25 Nov 2015
Category Administration
avatar zero-24 zero-24 - change - 25 Nov 2015
Easy No Yes
avatar designbengel
designbengel - comment - 15 Apr 2016

I can´t reproduce the first two steps. Anything to add before to make the validation work?
thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8529.

avatar tranduyhung
tranduyhung - comment - 15 Apr 2016

@designbengel The steps I posted was just for seeing the problem which is not about the validation, it is about the language files, they are not loaded when the validation is made.

avatar designbengel
designbengel - comment - 15 Apr 2016

@tranduyhung - yes but the steps don´t work... i don´t get any errors. Configuration is saved without Errors.

avatar PixRob
PixRob - comment - 15 Apr 2016

Is this what you are looking for
Language key but no choice
2016-04-15_8529 language option

avatar tranduyhung
tranduyhung - comment - 15 Apr 2016

@designbengel I still can see this problem in Joomla 3.5.1.

screenshot at 2016-04-15 20 59 21
screenshot at 2016-04-15 20 58 45

avatar henkrijneveld
henkrijneveld - comment - 15 Apr 2016

testinstructions are wrong... must be: validate="email", stated: validation="email"


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8529.

avatar henkrijneveld henkrijneveld - test_item - 15 Apr 2016 - Tested successfully
avatar henkrijneveld
henkrijneveld - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on 24096bb

patch OK, testinstructions wrong (validation instead of validate)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8529.

avatar tranduyhung
tranduyhung - comment - 15 Apr 2016

Thank you @henkrijneveld The first step's instruction was wrong. My bad! Didn't notice it. The second one is correct.

avatar Iclamer Iclamer - test_item - 15 Apr 2016 - Tested successfully
avatar Iclamer
Iclamer - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on 24096bb


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8529.

avatar designbengel designbengel - test_item - 15 Apr 2016 - Tested successfully
avatar designbengel
designbengel - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on 24096bb

Thanks for the correction on the instructions @henkrijneveld


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8529.

avatar brianteeman brianteeman - change - 15 Apr 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 15 Apr 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8529.

avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 15 Apr 2016
Milestone Added:
avatar rdeutz rdeutz - change - 15 Apr 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-04-15 15:26:20
Closed_By rdeutz
avatar rdeutz rdeutz - close - 15 Apr 2016
avatar rdeutz rdeutz - merge - 15 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - close - 15 Apr 2016
avatar rdeutz rdeutz - reference | 45c74b0 - 15 Apr 16
avatar rdeutz rdeutz - merge - 15 Apr 2016
avatar rdeutz rdeutz - close - 15 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2016
Labels Removed: ?
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:

Add a Comment

Login with GitHub to post a comment