? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
15 Nov 2020

Pull Request for Issue #31345 and #31355

Summary of Changes

Adds a check to ensure that the client name can not be saved with just blank characters

Adds a check to ensure that the contact name can not be saved with just blank characters

Testing Instructions

  • log in to the backend
  • Goto Components-> Banners -> Clients
  • Click the New button and fill the form
  • While filling the form add ONLY tabs/spaces in "Contact Name" which is a required field.
  • Click on Save and close button
  • You can see the contact column for our added client is blank.

Repeat above for Client Name

Actual result BEFORE applying this Pull Request

Article is saved

Expected result AFTER applying this Pull Request

Article is not saved with error message saying why

Documentation Changes Required

none

avatar brianteeman brianteeman - open - 15 Nov 2020
avatar brianteeman brianteeman - change - 15 Nov 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Nov 2020
Category Administration com_banners
avatar brianteeman brianteeman - change - 15 Nov 2020
Labels Added: ?
avatar brianteeman brianteeman - change - 15 Nov 2020
The description was changed
avatar brianteeman brianteeman - edited - 15 Nov 2020
avatar richard67
richard67 - comment - 15 Nov 2020

@brianteeman Do I understand right that this PR here makes PR #31354 obsolete?

avatar ceford
ceford - comment - 16 Nov 2020

With spaces in Name or in Contact Name the error message says in both cases:

Save failed with the following error: Please provide a valid, non-blank title.

Can it be adjusted to say Name or Contact Name as appropriate?


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

avatar brianteeman
brianteeman - comment - 16 Nov 2020

it could be - means more strings for translators - is it really needed?

avatar infograf768
infograf768 - comment - 16 Nov 2020

Why this PR?
Is'nt #31354 fine?
If something has to be modified there, why not propose it there?
(I'm thinking of the maybe useless part concerning try/catch)

Also: JLIB_CMS_WARNING_PROVIDE_VALID_NAME uses the wording title. New strings are correctly used in #31354

Note: instructions are wrong as this does not concern article.

avatar brianteeman
brianteeman - comment - 16 Nov 2020

Sorry I didnt see the other PR - I just saw two open issues and wrote a PR to fix them - there was no reference on those issues

avatar infograf768
infograf768 - comment - 16 Nov 2020

If the try/catch is useless in #31354, please ask there to modify.
And, to encourage new testers/patchers, please close here as duplicate. ;)

avatar brianteeman
brianteeman - comment - 16 Nov 2020

As I said already I did not see the other PR as no one had referenced it on the issues and the issues were left open

avatar richard67
richard67 - comment - 16 Nov 2020

The other PR is from a new contributor, so maybe that's why it didn't reference the issues, or only one of them. Sure we should try not to discourage him, but if it is better to use this PR here then I can try to find some nice words there and ask him to close his PR.

avatar ceford
ceford - comment - 16 Nov 2020

I looked into how to solve this problem client side. It would be nice if we could get a Javascript guru to take this on:

Add class="validate-notwhite" to any form field that is required but must not be white space.

As an experiment, put this in the code that displays the form:

$doc->addScriptDeclaration('
jQuery(document).ready(function(){
	document.formvalidator.setHandler(\'notwhite\',
		function (value) {
			return value.trim().length > 0;
		});
	});
');

It would need something else for a field that is not required but if used must not be white space.

avatar toivo toivo - test_item - 16 Nov 2020 - Tested successfully
avatar toivo
toivo - comment - 16 Nov 2020

I have tested this item successfully on b2e0bf8

Tested successfully in Beta6-dev of 16 November


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

avatar gostn gostn - test_item - 16 Nov 2020 - Tested successfully
avatar gostn
gostn - comment - 16 Nov 2020

I have tested this item successfully on b2e0bf8


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

avatar richard67 richard67 - change - 16 Nov 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 16 Nov 2020

RTC


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

avatar infograf768
infograf768 - comment - 16 Nov 2020

Imho I don’t think this pr is better than the other one.
A simple reason: the other pr has clear new strings for the error.
The other possible reason is the try/catch code which may be missing here.

avatar brianteeman brianteeman - change - 16 Nov 2020
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2020-11-16 23:57:09
Closed_By brianteeman
Labels Added: ?
avatar brianteeman brianteeman - close - 16 Nov 2020

Add a Comment

Login with GitHub to post a comment