Skip to content

[4.0] Articles List Layout vote/ratings fields xml should not be switchers#31381

Merged
richard67 merged 5 commits intojoomla:4.0-devfrom
infograf768:4.0_listlayout
Nov 14, 2020
Merged

[4.0] Articles List Layout vote/ratings fields xml should not be switchers#31381
richard67 merged 5 commits intojoomla:4.0-devfrom
infograf768:4.0_listlayout

Conversation

@infograf768
Copy link
Member

@infograf768 infograf768 commented Nov 11, 2020

Summary of Changes

Vote and ratings fields are list and not switchers. Switchers there are not only displayed wrong but they do not allow to select Use Global settings.

EDIT: This PR also prevents the fields from being displayed when the vote plugin is disabled.

Testing Instructions

Create an articles category list menu item.
Display List Layouts tab.

Look at the Vote and Ratings fields

EDIT: Switch the vote plugin ON and OFF

Actual result BEFORE applying this Pull Request

Screen Shot 2020-11-11 at 07 21 25

Expected result AFTER applying this Pull Request

Screen Shot 2020-11-11 at 07 17 26

EDIT: See also #31381 (comment)

Documentation Changes Required

@ceford
Copy link
Contributor

ceford commented Nov 11, 2020

Did I do something wrong? My Show Votes in List and Show Ratings in List lists only have Use Global available. No Show or Hide!


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

@infograf768
Copy link
Member Author

Maybe you have to clear all caches?

@ceford
Copy link
Contributor

ceford commented Nov 11, 2020

This is what I see for a Category List menu item, after new login and clearing cache:

image

@infograf768
Copy link
Member Author

Have you enabled the vote plugin?

@ceford
Copy link
Contributor

ceford commented Nov 11, 2020

I have enabled the Vote plugin and I now see the drop-down lists. But, Use Global does not have (Show) or (Hide). It seems to me that these two fields should be absent if the plugin is not enabled. Also, it was not obvious to me what the difference was between Show Votes in List and Show Ratings in List. Would it helpful to have the label read Show Number of Votes in List - that does become more obvious when you see the list.


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

@sandewt
Copy link
Contributor

sandewt commented Nov 11, 2020

I have tested this item ✅ successfully on 3502c81

Joomla! 4.0.0-beta6-dev Development [ Mañana ] 27-October-2020 19:54 GMT

See comment


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

@sandewt
Copy link
Contributor

sandewt commented Nov 11, 2020

screen shot 2020-11-11 at 17 45 10
screen shot 2020-11-11 at 17 45 10


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

@infograf768
Copy link
Member Author

But, Use Global does not have (Show) or (Hide). It seems to me that these two fields should be absent if the plugin is not enabled.

I guess one has to save Articles Global Options at least once.

@ceford
Copy link
Contributor

ceford commented Nov 11, 2020

Having saved Articles Global Configuration I now see three items in each drop-down list. But if I go back and disable the Vote plugin I see this, with only this one item in the drop-down list:

image

Is that expected? I am just thinking about how to document this behaviour.

@brianteeman
Copy link
Contributor

If the plugin is disabled then ideally the option should not be displayed at all. Or at least it should be a readonly field with a value of hide. This complex configuration problem has been raised before :(

@sandewt
Copy link
Contributor

sandewt commented Nov 11, 2020

This complex configuration problem has been raised before :(

#18354 ?

@infograf768
Copy link
Member Author

@ceford
As the underlying issue is totally independent from this patch, please test it OK so that we set it RTC and merge.

The issue may be treated in another PR if someone works on it.

@infograf768
Copy link
Member Author

In fact, I have a solution for that issue.
If the vote plugin is NOT enabled, the fields would just not display, same as for config.xml

listitems

I am now modifying this PR to include the solution.

@infograf768
Copy link
Member Author

Added a new field VotelistField.php and used it for the vote/ratings fields for List Layout
Modifying test instructions
Please test again.

@ceford
Copy link
Contributor

ceford commented Nov 12, 2020

I have tested this item ✅ successfully on 3502c81

All OK if the Vote plugin is enables. I now see that, with the plugin disabled, Use Global (0) or Use Global (1) is the state of the global show flag.


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

@ceford
Copy link
Contributor

ceford commented Nov 12, 2020

And I can confirm the latest pr does not show the fields if the plugin is disabled.


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

@infograf768
Copy link
Member Author

Use Global (0) or Use Global (1) is the state of the global show flag.

This will not show anymore when plugin is disabled, whatever the settings in Global when it was enabled or not.

@ceford
Copy link
Contributor

ceford commented Nov 12, 2020

Help screen updated - that will take time to filter through the translation system.


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

@infograf768
Copy link
Member Author

@sandewt Please test.

@Quy
Copy link
Contributor

Quy commented Nov 12, 2020

Can you also please hide the Voting switch under Articles tab in Global Configuration?

@infograf768
Copy link
Member Author

Can you also please hide the Voting switch under Articles tab in Global Configuration?

Done in ab8b009

@sandewt
Copy link
Contributor

sandewt commented Nov 13, 2020

This does not look good with the disabled vote plugin.

31381-3

See line 288, delete the following code !?

<field
	name="spacer1"
	type="spacer"
	hr="true"
/>

@infograf768
Copy link
Member Author

@sandewt

See line 288, delete the following code !?

That is not the purpose of this PR.
As we have other instances of spacers in code, I suggest to change all these in another PR if desired.

Example:

Screen Shot 2020-11-13 at 08 47 40

Therefore, if this PR works as intended, please mark it such so that we can merge it.

@sandewt
Copy link
Contributor

sandewt commented Nov 13, 2020

That is not the purpose of this PR.
As we have other instances of spacers in code, I suggest to change all these in another PR if desired.

Rightly noted.

@sandewt
Copy link
Contributor

sandewt commented Nov 13, 2020

I have tested this item ✅ successfully on ab8b009

Joomla! 4.0.0-beta6-dev Development [ Mañana ] 27-October-2020 19:54 GMT


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

@infograf768
Copy link
Member Author

RTC thanks for testing.


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Nov 13, 2020
@richard67 richard67 merged commit 502118b into joomla:4.0-dev Nov 14, 2020
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Nov 14, 2020
@richard67
Copy link
Member

Thanks!

@richard67 richard67 added this to the Joomla 4.0 milestone Nov 14, 2020
@infograf768 infograf768 deleted the 4.0_listlayout branch November 14, 2020 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants