No Code Attached Yet
avatar heelc29
heelc29
9 Nov 2022

Steps to reproduce the issue

  1. The plugin is searching for a commonwords file like in that folder(/administrator)/language/xx-xx/xx-xx.com_finder.commonwords.txt

    if ($extension->client_id == 0) {
    $path = JPATH_SITE . '/language/' . $extension->element . '/' . $extension->element . '.com_finder.commonwords.txt';
    } else {
    $path = JPATH_ADMINISTRATOR . '/language/' . $extension->element . '/' . $extension->element . '.com_finder.commonwords.txt';
    }

    The core file (for lang en-GB) was renamed from language/en-GB/en-GB.com_finder.commonwords.txt to language/en-GB/com_finder.commonwords.txt in PR #27130

  2. A language pack consists of three parts site, admin, api. Even if the site language contains the file (with correct file name), they will be deleted again if the admin/api language is installed afterwards

    if ($extension) {
    $this->removeCommonWords($extension);
    $this->addCommonWords($extension);
    }

Expected result

Plugin should work as expected (when commonwords are needed)

Actual result

  • clean installation
  • check database #___finder_terms_common
  • some values for "en" are present
  • install an en lang pack for example (en-US)
  • check database #___finder_terms_common
  • values are deleted
  • install any other lang pack
  • table is still empty

System information (as much as possible)

J4.x

cc @Hackwar

avatar heelc29 heelc29 - open - 9 Nov 2022
avatar joomla-cms-bot joomla-cms-bot - change - 9 Nov 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Nov 2022
avatar Hackwar
Hackwar - comment - 10 Nov 2022

I fixed the first part in #39188, but regarding the second complaint, I'm calling this by design. It is not as if the common words would make a big difference or something and I expect there to be just one such file in the different language files.

avatar richard67
richard67 - comment - 13 Nov 2022

@Hackwar @heelc29 Would it be a solution for the 2nd part of the issue if we do the removeCommonWords and addCommonWords only when the client of the extension is equal to 'site'?

Currently when installing a complete language pack we can rely on the site client being installed as last because it comes as last in the alphabetical order of the clients (administrator, api, site). But there is still the possibility that people install languages separately and not as package. And if in future someone invents a new client named 'whatever' we will have the problem again, too.

avatar heelc29
heelc29 - comment - 13 Nov 2022

@richard67 #39188 (comment)

The order of installation will depend on the package manifest.

Additional note about client ids:
0 = site
1 = administrator
2 = installation
3 = api

avatar heelc29 heelc29 - close - 16 Nov 2022
avatar heelc29
heelc29 - comment - 16 Nov 2022
avatar heelc29 heelc29 - change - 16 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-16 20:27:18
Closed_By heelc29

Add a Comment

Login with GitHub to post a comment