Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Don't show help button if no help URL or reference is defined #35662

Merged
merged 3 commits into from Nov 3, 2021

Conversation

Bakual
Copy link
Contributor

@Bakual Bakual commented Sep 24, 2021

Currently, a help button is shown always in com_categories, com_config and com_modules (and maybe other places), regardless if the extension actually has a help page or not.

Summary of Changes

  • Backend Categories list and edit views as well as Component Options view are changed so they check if a language string actually exists before addding it as ref_key for the help button
  • ToolbarHelper::help() only creates the help button if either $ref or $override is passed.
  • Fixed three notices in the categories view about undefined variables in case no help is specified.

Testing Instructions

Check with a 3rd party extension if the help button either works (one is specified) or doesn't appear (if none is specified) in:

  • Categories list
  • Category edit form
  • Component Options
  • Module Options

Actual result BEFORE applying this Pull Request

Help button is always shown. If no help is specified, the help page will show a RuntimeException error
image

Expected result AFTER applying this Pull Request

Help button doesn't appear when no help is specified
No change to before if help is specified.

Documentation Changes Required

None

@chmst
Copy link
Contributor

chmst commented Sep 25, 2021

I have tested this item ✅ successfully on ab6334e

Tested with com_weblinks and all views: categories, category, options modules, com_config.


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

@ChristineWk
Copy link

Some tries with: com_weblinks - History:
Patch ON:

A) Modules > Web Links > Help
if Module is activated = OK, no error.
If Module is not actived (unpublished) = Actual result: error.

B) Components > Web Links > Help > Categories > Options = OK

C) with and without Patch:
Web Links > Links >
An error has occurred.
500 behavior::tabstate not found. *)

After above, System shows Update available for Weblinks Extension Package: to: 4.0.0
Done.

C) Fields and Fieldgroups are now added.

Patch ON again:
Web Links > Links
*) 500 error has gone, but: > error 404 - RuntimeException

See A) above: After Update to 4.0.0 Result changed to:
if Module is activated = Actual result: error.
If Module is not actived (unpublished) = Actual result: error.

Maybe some changes between Version 3.9.0 and 4.0.0

System version: 4.0.4-dev


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

@Bakual
Copy link
Contributor Author

Bakual commented Sep 26, 2021

@ChristineWk I'm a bit confused from your test results. As this PR here is only about the help button, some of your errors look unrelated to this PR and instead are bugs in weblinks itself?

@ChristineWk
Copy link

@Bakual

sorry about, I'am also confused :-) Patch = ON:

Web Links > Categories > Options (Help button is removed) = successful.

Web Links > Links > Help (Help button visible) > Help: 404 - RuntimeException
= not successful.

Web Links > Fields (= new with update to 4.0.0) > (Help button visible) > Help Function = OK.

Web Links > Field Groups (= new with update to 4.0.0) > (Help button visible) > Help Function = OK.

Site Modules:
Web Links (activated) > Web Links > Help button > 404 – RuntimeException
(there was no error with before installed version: 3.9.0)

Web Links (not activated) > Web Links > Help button > 404 – RuntimeException

screen shot 2021-09-26 at 13 37 15


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

@ChristineWk
Copy link

ChristineWk commented Sep 26, 2021

OK, it was my mistake. Before that, version 3.9.0 was offered and installed via web installation.
After that I was offered the right package.
Current: Web Links Administrator Component 4.0.0 2021-09-19
Result: see above.


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

@Bakual
Copy link
Contributor Author

Bakual commented Sep 26, 2021

I'll try with Weblinks and see what's wrong there. I suspect some error on weblinks side, but need to be sure first :-)
Thanks for the tests!

@Bakual
Copy link
Contributor Author

Bakual commented Sep 27, 2021

Web Links > Links > Help (Help button visible) > Help: 404 - RuntimeException
= not successful.

Reason is a bug in Weblinks:
https://github.com/joomla-extensions/weblinks/blob/8aa92f906b7ea2740b245bbc999a6cf304528d0f/src/administrator/components/com_weblinks/src/View/Weblinks/HtmlView.php#L185
There is a language string is specified, but it doesn't exist. Thus the resulting link is broken.
Changing it directly to Components_Weblinks_Links or adding a language string with this value (not recommended) will fix it.

Same issue with the module:
https://github.com/joomla-extensions/weblinks/blob/8aa92f906b7ea2740b245bbc999a6cf304528d0f/src/modules/mod_weblinks/mod_weblinks.xml#L20
The correct value here would be Extensions_Module_Manager_Weblinks

(Correct values taken from https://docs.joomla.org/Help310:Help_screens)

@Bakual
Copy link
Contributor Author

Bakual commented Sep 27, 2021

PR done for the weblinks errors.

@ceford
Copy link
Contributor

ceford commented Oct 21, 2021

How do we find the views that should have Help pages but don't? In the past users would report a bug. I found several missing Help pages myself and created them.


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

@brianteeman
Copy link
Contributor

See the testing instructions

@Bakual
Copy link
Contributor Author

Bakual commented Oct 21, 2021

There is also an overview over the existing help pages here: https://docs.joomla.org/Help310:Help_screens

@ceford
Copy link
Contributor

ceford commented Oct 21, 2021

I have tested this item ✅ successfully on ab6334e

The Patch Tester extension has a Help button which disappears when the patch is applied - so it works as described.

The point I was trying to make in my comment was not clear: had I not created a dozen or more new Help pages last summer you could now have had that many more HtmlView files to fix now. And I know about the list of Help pages because I updated the Joomla 4 version myself. What I was alluding to is that it would be better to create missing Help pages than hide the fact they are missing. Third party developers have the option to leave out the Help link or point it to another server. I do that for one of my components. And for another one I use local Help files. Anyway, if there are no missing core Joomla Help pages I am happy.


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

@brianteeman
Copy link
Contributor

Ah I see that you still missed the point @ceford This is nothing to do with missing core help pages

Before this PR if your component used categories then there was automatically a help button present for the categories page even though there was no help page. As an extension developer you didnt have to do anything to create that button - it was automatic. There was also no way for you to remove the help button. This PR prevents these automatic help buttons being created unless they have been defined

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 22, 2021
@bembelimen bembelimen merged commit 28c346d into joomla:4.0-dev Nov 3, 2021
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Nov 3, 2021
@bembelimen
Copy link
Contributor

Thx

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.

None yet

9 participants