?
avatar shoulders
shoulders
10 Nov 2020

If you look at the line

// If the extension type has it own language key, use it, otherwise, use default language key
if ($this->app->getLanguage()->hasKey('PLG_ACTIONLOG_JOOMLA_' . $extensionType . '_UPDATED'))

The translation string is not correctly converted in to a fully UPPERCASE string like

// If the extension type has it own language key, use it, otherwise, use default language key
if ($this->app->getLanguage()->hasKey(strtoupper('PLG_ACTIONLOG_JOOMLA_' . $extensionType . '_UNINSTALLED')))

Notes

  • So just adding strtoupper() to this onExtensionAfterUpdate() to match the similiar functions onExtensionAfterUninstall() and onExtensionAfterInstall() in this class will fix this.
  • The lack of this strtoupper() might cause the key lookup to fail.
avatar shoulders shoulders - open - 10 Nov 2020
avatar joomla-cms-bot joomla-cms-bot - change - 10 Nov 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Nov 2020
avatar SharkyKZ
SharkyKZ - comment - 10 Nov 2020

This shouldn't really be an issue because related methods in language class run keys through strtoupper().

avatar shoulders
shoulders - comment - 10 Nov 2020

true, but it should match the other methods/statements. 😄

avatar infograf768
infograf768 - comment - 10 Nov 2020

We have multiple examples of this kind of code.
$this->toc[$key] = Text::_('COM_ADMIN_HELP_' . $value);
Text::_('COM_BANNERS_FIELD_VALUE_' . $purchaseTypes[$params->get('purchase_type')])
$label = empty($fieldSet->label) ? 'COM_CONFIG_' . $name . '_FIELDSET_LABEL' : $fieldSet->label; ?>
$lang_key = 'PLG_FINDER_STATISTICS_' . str_replace(' ', '_', $type->type_title);
<?php echo Text::_('COM_PRIVACY_HEADING_REQUEST_TYPE_TYPE_' . $item->request_type); ?>

etc. etc.

if we start adding strtoupper() to all such occurrences in core, this would add quite a work.

Welcome to propose patch.

avatar shoulders
shoulders - comment - 10 Nov 2020

@infograf768

  • Not sure what you are showing me, all I know is that this method's code does not match its neighbours in the same class, which it should.
  • The rest of the similiar statements in this class have strtoupper().
  • Literally it just needs strtoupper() adding.

Welcome to propose patch = I dont know how to and I discovered this whilst building my first component so i need to finish that before learning something else. 😄

avatar infograf768
infograf768 - comment - 10 Nov 2020

The samples above comes from core code in various places where strtoupper() is not used but it's working fine as @SharkyKZ righfully commented.

avatar ReLater
ReLater - comment - 10 Nov 2020

true, but it should match the other methods/statements

I would remove strtoupper() from other methods (consistency and less code) if nothing fails then.

avatar brianteeman
brianteeman - comment - 8 Apr 2021

This should be closed if no one is going to create the pr

avatar HLeithner HLeithner - change - 8 Apr 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-04-08 16:53:32
Closed_By HLeithner
avatar HLeithner HLeithner - close - 8 Apr 2021
avatar HLeithner
HLeithner - comment - 8 Apr 2021

We have a pull request #33072

Add a Comment

Login with GitHub to post a comment