joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.1] Correct message type for Redirect plugin state

Open Fedik opened this issue 9 months ago • 16 comments

Pull Request for Issue https://github.com/joomla/joomla-cms/issues/43298 .

Summary of Changes

Use "notice" instead of "warning" for informative messages.

Testing Instructions

Please follow https://github.com/joomla/joomla-cms/issues/43298

Actual result BEFORE applying this Pull Request

Yellow message

Expected result AFTER applying this Pull Request

Blue message

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org:
  • [x] No documentation changes for docs.joomla.org needed
  • [ ] Pull Request link for manual.joomla.org:
  • [x] No documentation changes for manual.joomla.org needed

Reference:

  • https://github.com/joomla/joomla-cms/pull/42447

Fedik avatar Apr 30 '24 07:04 Fedik

This does not solve #43298

This is how it should be - note that the message is completely wrong in test 3 and in test 2 it should be info not warning

brianteeman avatar Apr 30 '24 08:04 brianteeman

it should be info not warning

It is "notice", as it was before in 5.0 and in j4.

Fedik avatar Apr 30 '24 09:04 Fedik

tbh, this messages is useless, why do we have them in first place? Only a warning about disabled plugin is good enough.

Fedik avatar Apr 30 '24 09:04 Fedik

Please READ the report more carefully. The messages are NOT useless.

I realise that there is a lot of variants but currently AND with this PR the following message is completely wrong!!!

When the plugin is enabled any redirects that have been created in the component will take effect. When the plugin is enabled there is an additional option to collect urls. Collecting urls is independent of redirecting urls.

It says The Redirect System Plugin is disabled. It needs to be enabled for this component to work. It should say The Redirect Plugin is enabled. The 'Collect URLs' option in the Redirect System Plugin is disabled. Error page URLs will not be collected by this component.

I am wondering now if you did not realise the complete use of the plugin and component when you rewrote this part of the code as it makes no sense.

The current code as changed in #42447 is simply wrong.

You never check if the plugin is enabled or disabled. You only check if the plugin exists

brianteeman avatar Apr 30 '24 11:04 brianteeman

It is (almsot) 1:1 copy of what was before: Old: https://github.com/joomla/joomla-cms/blob/301bdf2b2879277e66693f7c4ce62d9265d18462/administrator/components/com_redirect/src/Controller/DisplayController.php#L54-L77

New: https://github.com/joomla/joomla-cms/blob/b947df6d05cc10d87ac6dce76d6cf9e30e661266/administrator/components/com_redirect/tmpl/links/default.php#L34-L67

Maybe something wrong with redirectPluginId or with that if() condition, who knows.

Fedik avatar Apr 30 '24 11:04 Fedik

Its not the same - this is where the mistake is

ORIG https://github.com/joomla/joomla-cms/blob/301bdf2b2879277e66693f7c4ce62d9265d18462/administrator/components/com_redirect/src/Controller/DisplayController.php#L54-L55

NEW https://github.com/joomla/joomla-cms/blob/b947df6d05cc10d87ac6dce76d6cf9e30e661266/administrator/components/com_redirect/tmpl/links/default.php#L34-L35

redirectPluginId gets the ID of the plugin pluginEnabled gets the state of the plugin

brianteeman avatar Apr 30 '24 12:04 brianteeman

redirectPluginId gets the ID of the plugin

It is there only when the plugin is disabled https://github.com/joomla/joomla-cms/blob/a1cdbc1df055f325061ef92274587e9479f5f443/administrator/components/com_redirect/src/View/Links/HtmlView.php#L139-L141

Fedik avatar Apr 30 '24 12:04 Fedik

I give up - I am clearly unable to explain what should be very obvious. Your changed code in #42447 produces the wrong message and this PR makes no changes to correct that.

Instead of saying

The Redirect Plugin is enabled. The 'Collect URLs' option in the Redirect System Plugin is disabled. Error page URLs will not be collected by this component.

Your code says

The Redirect System Plugin is disabled. It needs to be enabled for this component to work.

brianteeman avatar Apr 30 '24 12:04 brianteeman

I give up

Don't give up

Fedik avatar Apr 30 '24 13:04 Fedik

I dont know how else to explain the obvious

brianteeman avatar Apr 30 '24 13:04 brianteeman

Should work now. See, it was easy ;)

Fedik avatar Apr 30 '24 14:04 Fedik

image

brianteeman avatar Apr 30 '24 14:04 brianteeman

But messages are good? :) Changed that also, check again.

Fedik avatar Apr 30 '24 14:04 Fedik

I have tested this item :white_check_mark: successfully on 3e9f660202db26bc453cc730819fe39c53400ee5


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

brianteeman avatar Apr 30 '24 18:04 brianteeman

I have tested this item :white_check_mark: successfully on 3e9f660202db26bc453cc730819fe39c53400ee5


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

viocassel avatar May 02 '24 00:05 viocassel

RTC


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

alikon avatar May 02 '24 07:05 alikon

Thanks!

bembelimen avatar May 11 '24 09:05 bembelimen