? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
2 Sep 2017

Summary of Changes

The string
MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE=""

should NOT have been deleted! ( see #12467 )
When the value is not set it automatically loads the Languages forums page with the correct text
For en-GB it gives

screen shot 2017-09-02 at 11 58 10

When value is set to the correct language forum (for example 19 for French, it loads the French Language forum.

screen shot 2017-09-02 at 11 59 31

avatar joomla-cms-bot joomla-cms-bot - change - 2 Sep 2017
Category Administration Language & Strings
avatar infograf768 infograf768 - open - 2 Sep 2017
avatar infograf768 infograf768 - change - 2 Sep 2017
Status New Pending
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 Sep 2017

Got same Menu as shown in above Screenshot for French Lang. without Pull Request:
bildschirmfoto 2017-09-02 um 12 08 28

avatar infograf768
infograf768 - comment - 2 Sep 2017

@franz-wohlkoenig
yes you get that because we kept the string in fr-FR although it is deleted in en-GB. That is how I found it was missing in en-GB.
It is necessary to have the string as it shows to Translation Teams. For example TTs using crowdin will not even know it exists...

remark the comment above the missing string in en-GB.mod_menu.ini:
; The string below will be used if MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE has a value, i.e the # of the specific language forum in https://forum.joomla.org/. Use something like 'Official english forum'.
But no string below...

avatar infograf768
infograf768 - comment - 2 Sep 2017

Can be merged on review.

avatar mbabker mbabker - change - 2 Sep 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-09-02 15:49:48
Closed_By mbabker
Labels Added: ? ?
avatar mbabker mbabker - close - 2 Sep 2017
avatar mbabker mbabker - merge - 2 Sep 2017
avatar wojsmol
wojsmol - comment - 2 Sep 2017

@infograf768 IMHO this PR is wrong see code

<menuitem
type="url"
target="_blank"
title="MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM"
link="index.php?option=com_admin&amp;view=help&amp;layout=langforum"
class="class:help-forum"
scope="help"
/>

and
$forumId = (int) JText::_('COM_ADMIN_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
$forum_url = 'https://forum.joomla.org/viewforum.php?f=' . $forumId;

avatar infograf768
infograf768 - comment - 2 Sep 2017

@wojsmol
That is real weird!!!.
This has been changed some time ago without my knowledge.
It was still working in 3.7.4 !!!
I agree we have an issue here.

@mbabker
I will look into this tomorrow. mod_menu.ini is always loaded. Will see why it was changed in 3.8.0

avatar wojsmol
wojsmol - comment - 2 Sep 2017

@infograf768 This has been changed as part of #16451.

avatar infograf768
infograf768 - comment - 3 Sep 2017

@wojsmol
Yes, I found that too.
I am trying now to get it right and if we can't use the mod_menu string, I will inform TTs of this change.

avatar wojsmol
wojsmol - comment - 3 Sep 2017

Another good idea would be to replace the link to the subforum in forum.joomla.org with a link to an external community forum. This would be useful if the .org subforum is less active then the external forum.

avatar infograf768
infograf768 - comment - 3 Sep 2017

The new custom admin menus have also broken the mod_menu parameter forum_url

avatar infograf768
infograf768 - comment - 3 Sep 2017

Another good idea would be to replace the link to the subforum in forum.joomla.org with a link to an external community forum.

We never allowed that as it would allow Translators to give an advantage to their own site. It's part of the policy with Translation Teams.

The mod_menu forum_url parameter was created to let custom distribs add such a link, or users to add or modify this. Not the TTs.

avatar infograf768
infograf768 - comment - 3 Sep 2017

Before the custom admin menus and presets we had in enabled

if ($forum_url = $params->get('forum_url'))
	{
		$menu->addChild(
			new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank')
		);
	}
	$debug = $lang->setDebug(false);
	if ($lang->hasKey('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') && JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE') != '')
	{
		$forum_url = 'http://forum.joomla.org/viewforum.php?f=' . (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');
		$lang->setDebug($debug);
		$menu->addChild(
			new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM'), $forum_url, 'class:help-forum', false, '_blank')
		);
	}
avatar infograf768
infograf768 - comment - 3 Sep 2017

@izharaazmi
Please look at that urgently.

It looks like we can't load mod_menu strings in langforum.php.
If we could manage to do that, we could at least not modify that part of the strings.

We would just have to modify langforum.php this way

$forumId   = (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');

if (empty($forumId))
{
	$forumId = 511;
}

$forum_url = 'https://forum.joomla.org/viewforum.php?f=' . $forumId;

JFactory::getApplication()->redirect($forum_url);

and take off
COM_ADMIN_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE="511"

Otherwise, we will revert this PR, then make a new PR where the comments in mod_menu.ini are modified and add a comment in com_admin.ini new strings, then inform TTs.

We also need to correct the problem with the mod_menu forum_url parameter.

Still working on it though.

avatar izharaazmi
izharaazmi - comment - 3 Sep 2017

@infograf768 I'm traveling right now. I'll see to it tomorrow when at desk.

avatar infograf768
infograf768 - comment - 3 Sep 2017

For the custom lang forum, keeping this PR, we can do in helpforum.php

<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_admin
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JFactory::getLanguage()->load('mod_menu', JPATH_ADMINISTRATOR, null, false, true);

$forumId   = (int) JText::_('MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE');

if (empty($forumId))
{
	$forumId = 511;
}

$forum_url = 'https://forum.joomla.org/viewforum.php?f=' . $forumId;

JFactory::getApplication()->redirect($forum_url);

and take off the com_admin string
This will load the mod_menu string correctly.

@wojsmol
Can you install the French language and make this modification?
Then use French as backend language.
It should now load the French forum directly as we have the string in fr-FR

For the mod_menu param, it is another story.

avatar wojsmol
wojsmol - comment - 3 Sep 2017

@infograf768 This works as described.

avatar izharaazmi
izharaazmi - comment - 3 Sep 2017

@infograf768 sorry that I don't understand what we are trying to achieve here. Can you please summarise it for me. Thank you.

avatar infograf768
infograf768 - comment - 3 Sep 2017

@wojsmol
Thanks for testing.

@izharaazmi
I started working on the custom forum url depending on the module parameter.
To do this I added a customforum.php in com_admin/views/help/
and modified the default presets.
One issue remains: How to prevent displaying that submenu when the module parameter is empty.

See:
help.diff.zip

avatar infograf768
infograf768 - comment - 3 Sep 2017

@izharaazmi
siesta now. will explain all later

avatar izharaazmi
izharaazmi - comment - 3 Sep 2017

Yeah right. I'll think about that and come up with a solution hopefully.

avatar infograf768
infograf768 - comment - 3 Sep 2017

@izharaazmi

We have 2 issues.

  1. When you created the langforum.php and the new string COM_ADMIN_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE you did not remark (although you deleted it) that the string MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE already existed and was used by TTs to link to their forum.joomla.org specific language forum.
    That was clearly explained in the mod_menu.ini file (see above).

The patch I propose above #17836 (comment) solves that issue.
There is no reason to create a new string as we have an already existing one. Was only necessary to load the mod_menu.ini file.
Setting the string to "" in en-GB (done with this already merged PR) is covered by the patch if the string remains unchanged by some TTs.

The comment in the mod_menu.ini file has also to be modified:
; The string below will be used if MOD_MENU_HELP_SUPPORT_OFFICIAL_LANGUAGE_FORUM_VALUE has a value, i.e the # of the specific language forum in https://forum.joomla.org/. Use something like 'Official english forum'.
as the logic has changed, i.e. one now always get that link, whether it is to the specific language forum (19 for French) or the part of the forum (511) displaying all language forums.

  1. When implementing custom admin menus, you forgot that mod_menu was proposing a specific parameter to add a submenu in the help forum to anything one wanted, more specifically for Language Communities to add a link to their own forum.

screen shot 2017-09-03 at 16 17 45

This was done via the code in .../administrator/modules/mod_menu/tmpl/default_enabled.php

if ($forum_url = $params->get('forum_url'))
	{
		$menu->addChild(
			new JMenuNode(JText::_('MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM'), $forum_url, 'class:help-forum', false, '_blank')
		);
	}

That link may also be added or suggested by 3pd extensions.
For example it can be https://www.akeebabackup.com/documentation.html

This is what I started working on in the .zip diff I posted above and where I could not find a simple way to not display the Custom Forum submenu when the field is empty.

in mod_menu.ini, we have
; the string below will be used if the localised sample data contains a URL for the desired community forum or if the 'Custom Support Forum' field parameter in the Administrator Menu module contains a URL

MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM="Custom Support Forum"

Hope this helps understand.

avatar izharaazmi
izharaazmi - comment - 4 Sep 2017

Thank you @infograf768, for the details and now I understand it clear.

I recently came across 'com_pagebuilder' and another component (can't recall the name) that injected its menu in admin menu prior to J3.7 admin menu manager. Looks like now its not possible (or not easy) to do that anymore.

So I was wondering whether we should allow such things or not. If yes, then should there be a plugin event trigger that can allow us to manipulate menu items via plugin logic.

If we choose to go that way, the same could be useful for this too. Otherwise, I'd try to find something better. Please advise.

avatar infograf768
infograf768 - comment - 4 Sep 2017

@izharaazmi
For the moment, I will make a PR to solve the first issue as we must get this in 3.8.0

For the second issue, can't you devise a way to display such a conditional in your code to allow displaying or not one of the <menuitem in the presets?

In my zip above, I added

<menuitem
			type="url"
			target="_blank"
			title="MOD_MENU_HELP_SUPPORT_CUSTOM_FORUM"
			link="index.php?option=com_admin&amp;view=help&amp;layout=customforum"
			class="class:help-forum"
			scope="help"
		/>

and the conditional is the same as in the proposed new customforum.php

$module = JModuleHelper::getModule('mod_menu');
$params = new JRegistry($module->params);

if ($params->get('forum_url'))
etc.
avatar izharaazmi
izharaazmi - comment - 4 Sep 2017

Sure, I must get that work.

avatar infograf768
infograf768 - comment - 4 Sep 2017

Please test #17857
@wojsmol
@izharaazmi
as we have to get this urgently in staging

avatar infograf768
infograf768 - comment - 6 Sep 2017

@izharaazmi
How does it go with the second issue? It is a regression.

avatar izharaazmi
izharaazmi - comment - 6 Sep 2017

I've solved the hiding item conditionally issue. However, I'd be able to do
the PR on Friday only.

avatar infograf768
infograf768 - comment - 6 Sep 2017

👍

Add a Comment

Login with GitHub to post a comment