PR-4.3-dev ? Pending

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
27 Sep 2021

Summary of Changes

Enabled character counter for text fields

Testing Instructions

  1. Apply patch
  2. NPM i
  3. Open components/com_users/forms/registration.xml
  4. Add the following attributes to the "name" field:
    maxlength="30" charcounter="true"
  5. Go to the frontend registration and check the name field

Actual result BEFORE applying this Pull Request

Nothing different

Expected result AFTER applying this Pull Request

grafik

grafik

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
1.00

avatar bembelimen bembelimen - open - 27 Sep 2021
avatar bembelimen bembelimen - change - 27 Sep 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Sep 2021
Category JavaScript Repository Layout Libraries
avatar brianteeman
brianteeman - comment - 27 Sep 2021

Could this option be added to the custom fields as well?

avatar bembelimen bembelimen - change - 27 Sep 2021
Labels Added: ?
avatar bembelimen
bembelimen - comment - 27 Sep 2021

Could this option be added to the custom fields as well?

In theory, it could be added to any (input/textarea) field. Currently I activate it manually in my override via:
$form->setFieldAttribute('fieldname', 'charcounter', 'true', 'com_fields'); and it works "out-of-the-box".

But that's currently a "bigger" problem in Joomla! (in my opinion): we use for every field an unique layout (which is good on one side) but therefore are very inconsistent over all (like the suffix/prefix info are only available for normal text fields and not for e.g. number fields etc.).
Probably worth to have there a nicer solution.

avatar brianteeman
brianteeman - comment - 27 Sep 2021

like the suffix/prefix info are only available for normal text fields and not for e.g. number fields etc.

That is a bug that should be fixed ;)

avatar bembelimen
bembelimen - comment - 27 Sep 2021

like the suffix/prefix info are only available for normal text fields and not for e.g. number fields etc.

That is a bug that should be fixed ;)

Yes and no, it's failure by design :) the number field does not extend the text field and the layouts could be one base layout with just different attributes....But I guess this counts for many fields (like all dropdowns etc.)

avatar brianteeman
brianteeman - comment - 27 Sep 2021

it's failure by design :)

or by omission

avatar brianteeman brianteeman - test_item - 27 Sep 2021 - Tested successfully
avatar brianteeman
brianteeman - comment - 27 Sep 2021

I have tested this item successfully on 97294eb


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

avatar dgrammatiko
dgrammatiko - comment - 27 Sep 2021

@bembelimen I wouldn't enable that before fixing the counter to work nicely for repeatable fields. BTW the project should review the fields compatibility with repeatable fields and patch what's broken (ie a field with a counter in a repeatable will work only for the first instance, all others will miss the counter because there's no event to trigger the initialization...)

avatar bembelimen
bembelimen - comment - 27 Sep 2021

Hi @dgrammatiko do you mean this PR (as the problem is the same with textareas then) or the spreading over all fields?

avatar dgrammatiko
dgrammatiko - comment - 27 Sep 2021

as the problem is the same with textareas

Yes, the initialization of that script is missing the listener for subform add/removal part

the spreading over all fields?

There are many core fields that have issues or not working at all in subforms. Some are easy to patch (ie this one) others need some more changes

avatar brianteeman
brianteeman - comment - 27 Sep 2021

it will be more of an issue with this field - and I see an issue whereby the capabilities of a custom field are not in sync with an xml field.

I agree that all fields need to be reviewed with subforms - there are already a few open issues but thats beyond the scope here (I think)

avatar dgrammatiko
dgrammatiko - comment - 27 Sep 2021

it will be more of an issue with this field - and I see an issue whereby the capabilities of a custom field are not in sync with an xml field.

Probably the repeatable versions of input and textarea need also an update to expose this feature (if it's not already exposed, I haven't checked the code, I was commenting on the base that the core fields should play nicely with repeatables).
Anyways I provided the code needed

avatar brianteeman
brianteeman - comment - 29 Sep 2021

But that's currently a "bigger" problem in Joomla! (in my opinion): we use for every field an unique layout (which is good on one side) but therefore are very inconsistent over all (like the suffix/prefix info are only available for normal text fields and not for e.g. number fields etc.).

I just checked. Suffix and Prefix are available for every field - it is in the render options

image

image

avatar RickR2H RickR2H - test_item - 30 Sep 2021 - Tested successfully
avatar RickR2H
RickR2H - comment - 30 Sep 2021

I have tested this item successfully on 97294eb


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

avatar richard67 richard67 - change - 3 Oct 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 3 Oct 2021

RTC


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

avatar dgrammatiko
dgrammatiko - comment - 3 Oct 2021

@richard67 my comment is still valid, introducing this without support for repeatable fields is plain wrong ?

avatar richard67
richard67 - comment - 3 Oct 2021

@richard67 my comment is still valid, introducing this without support for repeatable fields is plain wrong ?

@dgrammatiko Sorry, was not clear to me that there is something remaining to be done since the PR has got 2 test.

@bembelimen What's the status of this PR? You want to leave it as it is, or do you want to adapt it to support repeatable fields?

avatar richard67 richard67 - change - 3 Oct 2021
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 3 Oct 2021

Back to pending due to ongoing clarifications.


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

avatar richard67 richard67 - change - 13 Nov 2021
Status Pending Needs Review
avatar richard67
richard67 - comment - 13 Nov 2021

Needs review.


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

avatar HLeithner
HLeithner - comment - 27 Jun 2022

This pull request has automatically rebased to 4.2-dev.

avatar joomla-bot
joomla-bot - comment - 27 Jun 2022

This pull requests has been automatically converted to the PSR-12 coding standard.

avatar HLeithner HLeithner - change - 27 Jun 2022
Labels Added: ? ?
Removed: ?
avatar mgscreativa
mgscreativa - comment - 20 Jul 2022

Hi! just using the brand new charcounter param in my edit message form like this

	<field
		name="title"
		type="text"
		label="COM_JAPPPUSH_FIELD_MESSAGE_TITLE_LABEL"
		maxlength="35"
		charcounter="true"
		required="true"
	/>

	<field
		name="body"
		type="textarea"
		label="COM_JAPPPUSH_FIELD_MESSAGE_BODY_LABEL"
		maxlength="160"
		charcounter="true"
	/>

Is it possible to apply this to the text input?

Thanks!


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

avatar richard67
richard67 - comment - 20 Jul 2022

Is it possible to apply this to the text input?

@mgscreativa Isn't that exactly what this pull request (PR) here here is doing?

If so, please test this PR and then mark your test result by going to the issue tracker here https://issues.joomla.org/tracker/joomla-cms/35678 and then using the blue "Test this" button at the top left corner, selecting the appropriate test result and submitting.

Every PR needs 2 successful tests by a human to get accepted, so if this PR solves your problem then please test it as described to bring it forward. Thanks in advance.

avatar mgscreativa
mgscreativa - comment - 21 Jul 2022

I have tested this item successfully on ae922dc

Tested ok, no issues!


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

avatar mgscreativa mgscreativa - test_item - 21 Jul 2022 - Tested successfully
avatar mgscreativa
mgscreativa - comment - 21 Jul 2022

Hi @richard67 done testing, works ok! Hope it gets in J 4.1


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

avatar RickR2H
RickR2H - comment - 29 Jul 2022

@bembelimen After building I get the error: Uncaught SyntaxError: missing ) after argument list (at short-and-sweet.min.js?1.0.4:10:104)
Don't know if it is related, but the counter does not show up. Could you take a look?

avatar richard67
richard67 - comment - 29 Jul 2022

@bembelimen After building I get the error: Uncaught SyntaxError: missing ) after argument list (at short-and-sweet.min.js?1.0.4:10:104)
Don't know if it is related, but the counter does not show up. Could you take a look?

Previous review comment already mentioned that. There is indeed a syntax error in the js. The closing single quote of a query selector string is missing.

avatar mgscreativa
mgscreativa - comment - 15 Aug 2022

Hi! is there anything else I can do to helpo this PR to pass? I'm using it in my site and it works just fine.

Thanks!

avatar richard67
richard67 - comment - 15 Aug 2022

As long as @bembelimen does not fix the syntax error in the JS mentioned above, it can not be accepted.

avatar mgscreativa
mgscreativa - comment - 17 Aug 2022

Hi @richard67 can I send another PR with the same changes to try to pass it through?

avatar mgscreativa
mgscreativa - comment - 17 Aug 2022

Hi! @bembelimen would yo be so kind to review this typo here to be able to pass this PR? https://github.com/joomla/joomla-cms/pull/35678/files#r926994733

Thanks!

avatar bembelimen bembelimen - change - 17 Aug 2022
Labels Added: ?
Removed: ?
avatar mgscreativa
mgscreativa - comment - 26 Aug 2022

Hi @richard67 Can I send a fresh new PR to pass this new feature? Because the original PR author doesn't respond at all...

avatar richard67
richard67 - comment - 26 Aug 2022

Hi @richard67 Can I send a fresh new PR to pass this new feature? Because the original PR author doesn't responds at all...

@mgscreativa Let's wait a bit more. I've just notified him again.

avatar bembelimen bembelimen - change - 9 Sep 2022
Labels Added: PR-4.3-dev
Removed: ?
avatar obuisard
obuisard - comment - 23 Sep 2022

I have tested this item successfully on e13df24


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

avatar obuisard obuisard - test_item - 23 Sep 2022 - Tested successfully
avatar sdwjoomla
sdwjoomla - comment - 23 Sep 2022

I have tested this item successfully on e13df24


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

avatar sdwjoomla sdwjoomla - test_item - 23 Sep 2022 - Tested successfully
avatar obuisard obuisard - change - 24 Sep 2022
Status Needs Review Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-09-24 01:14:28
Closed_By obuisard
avatar obuisard obuisard - close - 24 Sep 2022
avatar obuisard obuisard - merge - 24 Sep 2022
avatar obuisard
obuisard - comment - 24 Sep 2022

Thank you Benjamin @bembelimen!

avatar obuisard
obuisard - comment - 24 Sep 2022

Add a Comment

Login with GitHub to post a comment