Joomla 4.1.
I want to create custom article vote plugin. There is no problem with plugin itself, but I found an interesting thing:
If plugin Content - Vote is disabled there is no "Voting" setting in Article manager setting - Article.
In plugins/content/vote/vote.php we see a checking $params (line 116):
if (empty($params) || !$params->get('show_vote', null)) { return ''; }
The fields with types Voteradio and Votelist has it's own checking:
File administrator/components/com_content/src/Field/VotelistField.php (line 47)
File administrator/components/com_content/src/Field/VoteradioField.php (line 47)
if (!PluginHelper::isEnabled('content', 'vote')) { return false; }
if (empty($params) || !$params->get('show_vote', null)) { return ''; }
The decision is to remove checking if (!PluginHelper::isEnabled('content', 'vote'))
from fields files:
File administrator/components/com_content/src/Field/VotelistField.php (line 47)
File administrator/components/com_content/src/Field/VoteradioField.php (line 47)
So If the community agrees I can make a PR.
Labels |
Added:
No Code Attached Yet
|
joomla-cms/plugins/content/vote/vote.php
Line 116 in f9cb42d
$params->get('show_vote', null)
if (empty($params) || !$params->get('show_vote', null)) { return ''; }
$params->get('show_vote', 0) != 0
if (empty($params) || $params->get('show_vote', 0) != 0) { return ''; }
It seems to me it makes more sense to explicitly set the parameter than not to have it at all.
@sergeytolkachyov is this an issue for joomla core? If not, could you please close it?
Labels |
Added:
Information Required
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-04-04 10:02:50 |
Closed_By | ⇒ | sergeytolkachyov |
The problem is that for those people not using your plugin they will no longer be able to disable votes