- Issue created by @SirClickALot
- π«π·France mably
Actually I got the idea from here: https://www.drupal.org/project/glossify/issues/3269949 β¨ Add in a synonyms feature Needs work
Here is what is said there:
With my patch, both "President of the United States" and "POTUS" are candidates to be glossified. Since my sites require only the first found match be glossified, if one term is glossified then the other will not be, regardless of which one occurs first.
But may be we can add a configuration option to behave differently.
- π¬π§United Kingdom SirClickALot Somerset
@mably,
OK, I get that and I agree the it is actually sound idea too.
However, in our case matching only the first is the polar opposite of what we need because we have a whole lot of terminology splattered around the place, all of which actually means the same thing and it's really confusing the novices.
Thinking on my feet here possibly the most commonly encountered one is...
You can do this quickly and easily in the console.
You can do this quickly and easily in the shell.
You can do this quickly and easily in the CLI.
You can do this quickly and easily in the terminal.
You can do this quickly and easily in the command prompt.
You can do this quickly and easily in the REPL.
You can do this quickly and easily in the TTY.If we set aside splitting hairs about true definitions, all of those sentences are 'saying' exactly the same thing so one can see quite why we want to link all of those synonyms to a unifying description that covers all bases.
And that's just the start of it in the computing tutorial world!
So in summary yes, we agree wholeheartedly that, if using a synonym mechanism (such as the Synonyms module), there should be an option to check a box to say Target all synonyms for 'glossification' or not, depending on your use case.
Everybody's catered for, everybody's happy.
PS,
I like the POTUS example, it is especially in the zeitgeist.
Perhaps POTUSageddon is fitting. - π«π·France mably
@sirclickalot the fix has been included in this issue's MR: β¨ POC: use ABBR HTML elements for glossary terms Active
Feel free to give it a try.
- π¬π§United Kingdom SirClickALot Somerset
@mably - thanks for that.
After patching with MR: #3506501 I am hitting a WSD with...
[15-Feb-2025 05:31:11 UTC] Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\term_glossary\Service\TermGlossaryManager::__construct(), 7 passed in C:\Users\nick\Sites\bit-by-bit.org\public_html\core\lib\Drupal\Component\DependencyInjection\Container.php on line 261 and exactly 8 expected" at C:\Users\nick\Sites\bit-by-bit.org\public_html\modules\contrib\term_glossary\src\Service\TermGlossaryManager.php line 72
I suspect this might be PHP version related as we are on 8.3.7 but rolling that back to 8.2 and even below seems to cause other ill effects for us with other modules so not an option.
Rolling back to 4.2.0-alpha6 for now.
- π«π·France mably
Have you purged all the caches?
The new plugin manager service has been added as a constructor parameter to the Term Glossary service.
I just merged it to the dev branch so it will be easier to test.
- π«π·France mably
@sirclickalot if dev branch is ok for you, I'll make an alpha7 release.
- π¬π§United Kingdom SirClickALot Somerset
@mably,
I updated to the DEV branch using composer but to avail - same issue as before - WSD and...
[15-Feb-2025 09:40:18 UTC] Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\term_glossary\Service\TermGlossaryManager::__construct(), 7 passed in C:\Users\nick\Sites\bit-by-bit.org\public_html\core\lib\Drupal\Component\DependencyInjection\Container.php on line 261 and exactly 8 expected" at C:\Users\nick\Sites\bit-by-bit.org\public_html\modules\contrib\term_glossary\src\Service\TermGlossaryManager.php line 72
On both occasions I have done multiple cache clears before reporting.
I don't think this is PHP dependency/discovery relate is it, I think it might be a PHP 3.x+ issuse or do you suspect that my local site is still 'seeing' an older version of the service provided by
TermGlossaryManager.php
?BTW, I am not uninstalling and re-installing the module, could it somehow be related to new configuration that is only taking effect on reinstall?
- π«π·France mably
Pretty strange...
You could check the number of parameters you have in the
TermGlossaryManager
constructor here:https://git.drupalcode.org/project/term_glossary/-/blob/4.2.x/src/Servic...
And the number of corresponding parameters declared in the
services.yml
file here:https://git.drupalcode.org/project/term_glossary/-/blob/4.2.x/src/Servic...
Are you using with Docker?
When using Docker I noticed that, sometimes, the latest file changes are not picked up.
I just need to restart my Drupal container to have things running fine again.
- π¬π§United Kingdom SirClickALot Somerset
@mably,
Everything present and correct in both Service PHP code and the associated YAML file.
But hang on, if I'm reading this right, it's not the the service itself that the complaint is about, it's whatever is instantiating it that is at fault because it is supplying only 7 arguments when the code in the constructor for
TermGlossaryHandlerPluginManager
is clearly requiring 8?[15-Feb-2025 10:32:22 UTC] Uncaught PHP Exception ArgumentCountError: "Too few arguments to function Drupal\term_glossary\Service\TermGlossaryManager::__construct(), 7 passed in C:\Users\nick\Sites\bit-by-bit.org\public_html\core\lib\Drupal\Component\DependencyInjection\Container.php on line 261 and exactly 8 expected" at C:\Users\nick\Sites\bit-by-bit.org\public_html\modules\contrib\term_glossary\src\Service\TermGlossaryManager.php line 72
Also for clarity, I am not using Docker - I've always found it to be too sluggish so I simply use the good old native WAMP PRO for Windows.
- π«π·France mably
It looks like Drupal is not picking up the new
services.yml
for some reason...Some cache somewhere I guess.
- π¬π§United Kingdom SirClickALot Somerset
Experimentation continues...
No other PHP error logs except the one I mention above.
However, I have tried uninstalling the module and starting from scratch re-installing the DEV from the UI.
It seems to install OK and the modules page refreshed afterwards confirming the install.
But after a cache clear, I am seeing something new and different to before...
[15-Feb-2025 11:08:04 UTC] Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "" plugin does not exist. Valid plugin IDs for Drupal\term_glossary\TermGlossaryHandlerPluginManager are: custom_js, default" at C:\Users\nick\Sites\bit-by-bit.org\public_html\core\lib\Drupal\Component\Plugin\Discovery\DiscoveryTrait.php line 53
- π«π·France mably
Ha, ha, nice one, I think we are almost there.
Looks like you need to select the integration type on the module configuration page before using it.
Some checks are missing, I'll work on that to avoid those crashes when the module is not configured yet.
- π«π·France mably
Problem should be fixed by π WSD when used without proper configuration. Active π€
- π¬π§United Kingdom SirClickALot Somerset
@mably,
Brilliant!
Not only only does it address the issue, the Taxonomy Terms Glossary and Synonyms modules appear to working in perfect harmony ;-)
- π«π·France mably
Great news! Let's make that alpha7 release then π
Automatically closed - issue fixed for 2 weeks with no activity.