?
avatar PhilETaylor
PhilETaylor
5 Jul 2020

Steps to reproduce the issue

Install Joomla 4.0-dev with sample data
Enable User Registration
Enable Lang debug (for testing)

On frontend click "Create an account"
Dont complete the form
Click Register button
See red error message
Note that "error" is lowercase and not translatable

Expected result

**Error**

Actual result

error

Screenshot 2020-07-05 at 21 51 09

System information (as much as possible)

safari on mac

Additional comments

avatar PhilETaylor PhilETaylor - open - 5 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 5 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Jul 2020
avatar PhilETaylor PhilETaylor - change - 5 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 5 Jul 2020
avatar PhilETaylor
PhilETaylor - comment - 5 Jul 2020

same on the forgotten password page and forgotten username page

Screenshot 2020-07-05 at 22 20 42

avatar infograf768
infograf768 - comment - 6 Jul 2020

I can partly solve this by using in validate.js

          } else {
            message = Joomla.JText._('JLIB_FORM_CONTAINS_INVALID_FIELDS');
          }

          error = {
            [Joomla.JText._('ERROR')]: [message] // INSTEAD of error:[message]
          };
          Joomla.renderMessages(error);
        }

and adding
Text::script('ERROR');
in FormvalidateAssetItem.php method public function onAttachCallback(Document $doc)

	public function onAttachCallback(Document $doc)
	{
		// Add validate.js language strings
		Text::script('JLIB_FORM_CONTAINS_INVALID_FIELDS');
		Text::script('JLIB_FORM_FIELD_REQUIRED_VALUE');
		Text::script('JLIB_FORM_FIELD_REQUIRED_CHECK');
		Text::script('JLIB_FORM_FIELD_INVALID_VALUE');
		Text::script('ERROR');
	}

But I get the info blue color which is the default...

Screen Shot 2020-07-06 at 09 04 37

This issue may not only exists for this specific error, but for all js trigered errors as far as I could see.

avatar brianteeman
brianteeman - comment - 6 Jul 2020

@infograf768 its easier than that

Just add the following to the registration form etc

// Load JavaScript message titles
Text::script('ERROR');
Text::script('WARNING');
Text::script('NOTICE');
Text::script('MESSAGE');

avatar infograf768
infograf768 - comment - 6 Jul 2020

You are correct. Now remains to find out where it also has to be added.
Why not add these in the template index.php so to not bother anymore. That is what we do for installation.

avatar infograf768
infograf768 - comment - 6 Jul 2020

will do patch in index.php

avatar infograf768 infograf768 - change - 6 Jul 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-07-06 08:45:11
Closed_By infograf768
avatar infograf768 infograf768 - close - 6 Jul 2020
avatar infograf768
infograf768 - comment - 6 Jul 2020

Closing as we have a patch
#30022

Add a Comment

Login with GitHub to post a comment