? ? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
18 Dec 2020

Currently the field LimitboxField generates a hash so it doesn't have to calculate the options with each appearance of the same element. This is fine.
Howvere the has is created from $this->element which is a simpleXMLElement. We all know that stuff behaves very strange and in unexpected ways.
In this case, $hash = md5($this->element); doesn't create a hash based on the whole element with all its attributes. The hash is instead created on an empty simpleXMLElement (ignoring attributes) which ends up the same hash for each instance of the field.

Summary of Changes

This PR changes the hash so it is created from the XML string instead.

Testing Instructions

Simplest test would be to add two fields to the article form (administrator/components/com_content/models/forms/article.xml)
Within the fieldset "basic" add this lines:

		<field
			name="list_limit"
			type="limitbox"
			label="List"
			useglobal="true"
		/>
		<field
			name="feed_limit"
			type="limitbox"
			label="Feed"
			useglobal="true"
		/>

Now check the options tab in an article. And see the value in "Use Global"
If your installation has the default values, then the List field should show 20 and the Feed field should show 10 (values come from global configuration).

Actual result BEFORE applying this Pull Request

image

Both fields show the same value, because the hash is actually the same for both fields

Expected result AFTER applying this Pull Request

image

Fields are showing correct values since hashes are different.

Documentation Changes Required

None

avatar Bakual Bakual - open - 18 Dec 2020
avatar Bakual Bakual - change - 18 Dec 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Dec 2020
Category Libraries
avatar alikon
alikon - comment - 18 Dec 2020

I have tested this item successfully on bfac765


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

avatar alikon alikon - test_item - 18 Dec 2020 - Tested successfully
avatar gostn
gostn - comment - 19 Dec 2020

I have tested this item successfully on bfac765


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

avatar gostn gostn - test_item - 19 Dec 2020 - Tested successfully
avatar Bakual Bakual - change - 19 Dec 2020
Labels Added: ?
avatar Bakual
Bakual - comment - 19 Dec 2020

@alikon and @gostn Can you please retest? I applied a nice suggestion by @HLeithner

avatar Bakual Bakual - change - 19 Dec 2020
The description was changed
avatar Bakual Bakual - edited - 19 Dec 2020
avatar viocassel
viocassel - comment - 29 Dec 2020

I have tested this item successfully on e02b0f5


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

avatar viocassel viocassel - test_item - 29 Dec 2020 - Tested successfully
avatar gostn
gostn - comment - 29 Dec 2020

I have tested this item successfully on e02b0f5


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

avatar gostn gostn - test_item - 29 Dec 2020 - Tested successfully
avatar alikon alikon - change - 29 Dec 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 29 Dec 2020

RTC


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

avatar HLeithner HLeithner - change - 30 Dec 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-12-30 09:52:10
Closed_By HLeithner
Labels Added: ?
avatar HLeithner HLeithner - close - 30 Dec 2020
avatar HLeithner HLeithner - merge - 30 Dec 2020
avatar HLeithner
HLeithner - comment - 30 Dec 2020

thanks

Add a Comment

Login with GitHub to post a comment