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.1] Missing descriptions for options in settings #37772

Closed
Kostelano opened this issue May 10, 2022 · 23 comments
Closed

[4.1] Missing descriptions for options in settings #37772

Kostelano opened this issue May 10, 2022 · 23 comments

Comments

@Kostelano
Copy link
Contributor

Steps to reproduce the issue

Install Joomla RC1, note that in all components (for example, in the media manager) the descriptions for the parameters in the component settings have disappeared.

The problem is with this change. Remove the change on this line and the descriptions will revert to parameters.

As far as I can tell, this breaks the PR #37699, so I'm not sure how to properly fix this to keep PR #37699 working.

@Kostelano
Copy link
Contributor Author

While I was looking for a problem, 4.1.3 came out. The problem is the same there.

@richard67
Copy link
Member

Can the descriptions be enabled by using the Toggle Inline Help button?

@Kostelano
Copy link
Contributor Author

No. Because such a button is only in the general settings and somewhere else (I don’t remember the component).

@ReLater
Copy link
Contributor

ReLater commented May 10, 2022

Confirmed!
Where no button, descriptions hidden.
Where button, possibility to show them.

I don’t remember the component

com_content, articles

@ChristineWk
Copy link

#37158


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

@ReLater
Copy link
Contributor

ReLater commented May 10, 2022

37158

Yep. Another first merge then think ;-)

@Kostelano
Copy link
Contributor Author

@cyrezdev, could you help us?

Other components will be updated if it's ok with this PR the way i did it. ;-)

In any case, this should be fixed by one of us as soon as possible, as this is a "button car with no icons/tooltips" for both new Joomla users and non-advanced administrators.

@cyrezdev
Copy link
Contributor

cyrezdev commented May 12, 2022

Hello,
Maybe time to check this this weekend, but may not be related to my PR to first include the toggle button in com_content.

EDIT: in 4.1.2, no such issue, and my PR was already merged in it!
The issue is due to a change in 4.1.3

@sandewt
Copy link
Contributor

sandewt commented May 15, 2022

Same issue ?
Missing decriptions at the plugins, e.g. plugin Recaptcha (tabindex and callback):

description

@Kostelano
Copy link
Contributor Author

@sandewt Throughout the admin panel, except for the articles component and general settings (there is a button for switching hints).

But this is complete nonsense compared to the fact that in some localization string there is no dot at the end of the sentence.

@sandewt
Copy link
Contributor

sandewt commented May 15, 2022

there is a button for switching hints

@Kostelano I'm missing this button at the plugins or am i seeing it wrong ?

@Kostelano
Copy link
Contributor Author

@sandewt Yes, it is not in plugins and in all other components, except for the general settings and the materials component (added in https://github.com/joomla/joomla-cms/pull/37158/files#diff-250b59d27f418e931b052803c0a6089439df3f1ada6db18096ec9f9e5edb095c).

Screenshot_1

We need to either cancel this change, or make changes to all components in the same way as PR #37158.

@cyrezdev
Copy link
Contributor

We need to either cancel this change, or make changes to all components in the same way as PR #37158.

Cancel.
As even with addition of the toggle button in all core components, it will still be an issue for third-party extensions.
I didn't had the time yet to check, but the way would be to revert the change, and find a new way to improve integration.

@sandewt
Copy link
Contributor

sandewt commented May 15, 2022

The situation as it is now [J4.1.3] is unacceptable, because as with the plugins, the help texts disappear.

@Kubik-Rubik
Copy link
Member

Kubik-Rubik commented May 16, 2022

It is currently impossible to enable the descriptions for plugins and modules in Joomla! 4.1.3 without workarounds. This should be fixed asap! The inline help toggle button should be automatically displayed in the Modules (com_modules) and Plugins Manager (com_plugins).

In the meantime, 3rd Party developers can enable the descriptions by using a custom field type with a CSS instruction: https://docs.joomla.org/Creating_a_custom_form_field_type/en

Create the custom field type file (see documentation) and add the following code to the file:

protected function getLabel(): string
{
     Factory::getApplication()->getDocument()->addStyleDeclaration('div.hide-aware-inline-help.d-none {display: inline-block !important;}');

    return '';
}

But I agree with @cyrezdev, this is a backward compatibility break. Every extension must be rewritten to add the inline help toggle button. This is not acceptable for a bugfix release!

@cyrezdev
Copy link
Contributor

@Kubik-Rubik do you know how to get the inlinehelp xml element value from the renderField layout ?
As maybe adding this check in the field layout could fix the issue by adding the class d-none only if inlinehelp button exists.
And no B/C this way.

@Kubik-Rubik
Copy link
Member

If it is defined in the XML file like:

<inlinehelp button="show"/>

Then you can retrieve it in your custom field like:

$this->form->getXml()->config->inlinehelp['button'];

But this will not help us here; the inline toggle button must be added to the toolbar outside the parameters form.

@cyrezdev
Copy link
Contributor

cyrezdev commented May 16, 2022

I don't mean to add it in layout, but to get its value ;-)

And from the Joomla Layout rendefield (core field).
https://github.com/joomla/joomla-cms/pull/37699/files
This change from #37699 is meant to prevent "flash" while loading options page when inlinehelp toggle button is integrated.
But it is this PR which breaks descriptions display.

My wondering is how to properly get inlinehelp element if set in layouts/joomla/form/renderfield.php
So that d-none class could be added only if inlinehelp button integrated.
(and this would fix B/C issue)

I see form xml is in $displayData['field'] but i don't know how to get its elements values... in a clean way.
($this->form->getXml()->config->inlinehelp['button'] does not work in a layout context)

@Kubik-Rubik
Copy link
Member

@cyrezdev Yes, it would be possible. This is just a quick example of how to check for the Inline Help Toggle Button in the renderfield.php:

// after line 12
use Joomla\CMS\Toolbar\{Toolbar, Button\InlinehelpButton};

...

// after line 27
$inlinehelpButtonLoaded = false;
$toolbarItems = Toolbar::getInstance()->getItems();

foreach ($toolbarItems as $toolbarItem) {
    if ($toolbarItem instanceof InlinehelpButton) {
        $inlinehelpButtonLoaded = true;
        break;
    }
}

...

// after line 40
if (!$inlinehelpButtonLoaded) {
    $descClass = 'hide-aware-inline-help';
}

But this is not the proper approach since the file is loaded multiple times during one request. It would be better to set it as an option in \Joomla\CMS\Form\FormField::renderField.

@brianteeman
Copy link
Contributor

Even better would be to fix the actual bugs that I created

@cyrezdev
Copy link
Contributor

@Kubik-Rubik This is exactly what i thought, and why i was wondering if a "clean" way to get the option...
But you put me on a possible way, so i will open a PR! ;-)
Thanks!

@cyrezdev
Copy link
Contributor

I've created a PR #37819 to fix display of description.

@brianteeman @Kubik-Rubik @richard67 @Kostelano @ReLater @ChristineWk

@richard67
Copy link
Member

Closing as having a pull request. Please test #37819 . Thanks in advance.

bembelimen pushed a commit that referenced this issue May 18, 2022
* Add inlineHelp toggle button check

* Add inlineHelp toggle button control

* Add inlineHelp toggle button control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants