Issue fork hashtags-3127386

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Shruthi Shetty M created an issue. See original summary.

shruthi_shetty’s picture

Status: Active » Needs review
StatusFileSize
new2.41 KB
cuman’s picture

Thank you

I got it when

-    $fields  =\Drupal::entityManager()->getFieldDefinitions($entity_type, $bundle);
+    $fields  = \Drupal::service('entity_field.manager')->getFieldDefinitions($entity_type, $bundle);

instead of

-    $fields  =\Drupal::entityManager()->getFieldDefinitions($entity_type, $bundle);
+    $fields  =\Drupal::entityTypeManager()->getFieldDefinitions($entity_type, $bundle);
arlingtonvoicellc’s picture

I applied the patch, but I'm getting this error when I install the module:

Error: Call to a member function setFilterConfig() on null in hashtags_install() (line 16 of C:\wamp64\www\list\modules\contrib\hashtags\hashtags.install) #0 [internal function]: hashtags_install(false)
#1 C:\wamp64\www\list\core\lib\Drupal\Core\Extension\ModuleHandler.php(417): call_user_func_array(Object(Closure), Array)
#2 C:\wamp64\www\list\core\lib\Drupal\Core\Extension\ModuleInstaller.php(357): Drupal\Core\Extension\ModuleHandler->invoke('hashtags', 'install', Array)
#3 C:\wamp64\www\list\core\lib\Drupal\Core\ProxyClass\Extension\ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#4 C:\wamp64\www\list\vendor\drush\drush\src\Drupal\Commands\pm\PmCommands.php(103): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#5 [internal function]: Drush\Drupal\Commands\pm\PmCommands->enable(Array, Array)
#6 C:\wamp64\www\list\vendor\consolidation\annotated-command\src\CommandProcessor.php(257): call_user_func_array(Array, Array)
#7 C:\wamp64\www\list\vendor\consolidation\annotated-command\src\CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#8 C:\wamp64\www\list\vendor\consolidation\annotated-command\src\CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#9 C:\wamp64\www\list\vendor\consolidation\annotated-command\src\AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#10 C:\wamp64\www\list\vendor\symfony\console\Command\Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 C:\wamp64\www\list\vendor\symfony\console\Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 C:\wamp64\www\list\vendor\symfony\console\Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 C:\wamp64\www\list\vendor\symfony\console\Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 C:\wamp64\www\list\vendor\drush\drush\src\Runtime\Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 C:\wamp64\www\list\vendor\drush\drush\src\Runtime\Runtime.php(48): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 C:\wamp64\www\list\vendor\drush\drush\drush.php(72): Drush\Runtime\Runtime->run(Array)
#17 C:\wamp64\www\list\vendor\drush\drush\drush(4): require('C:\\wamp64\\www\\l...')
#18 {main}.
ramonvasconcelos’s picture

Assigned: Unassigned » ramonvasconcelos

I'll review this.

ramonvasconcelos’s picture

Assigned: ramonvasconcelos » Unassigned

I made some changes to the code, including the ones @cuman proposed. After the changes the module was working fine to me. I was able to add hashtags to my pages and also access the help page (the page was not working before the changes).

bruno.bicudo’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed this one.

Module works ok, no errors when applying the fix.

Also checked the error with the help page pointed by @ramonvasconcelos on #7, which i was able to reproduce. After applying the changes the error is gone.

So far so good, i'm moving to RTBC as everything seems ok :)

arlingtonvoicellc’s picture

Sorry, but still getting the same exact error with patch applied.

[error]  Error: Call to a member function setFilterConfig() on null in hashtags_install() (line 12 of C:\wamp64\www\list\modules\contrib\hashtags\hashtags.install) #0 [internal function]: hashtags_install(false)
#1 C:\wamp64\www\list\core\lib\Drupal\Core\Extension\ModuleHandler.php(417): call_user_func_array(Object(Closure), Array)
#2 C:\wamp64\www\list\core\lib\Drupal\Core\Extension\ModuleInstaller.php(357): Drupal\Core\Extension\ModuleHandler->invoke('hashtags', 'install', Array)
#3 C:\wamp64\www\list\core\lib\Drupal\Core\ProxyClass\Extension\ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#4 C:\wamp64\www\list\vendor\drush\drush\src\Drupal\Commands\pm\PmCommands.php(103): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#5 [internal function]: Drush\Drupal\Commands\pm\PmCommands->enable(Array, Array)
#6 C:\wamp64\www\list\vendor\consolidation\annotated-command\src\CommandProcessor.php(257): call_user_func_array(Array, Array)
#7 C:\wamp64\www\list\vendor\consolidation\annotated-command\src\CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#8 C:\wamp64\www\list\vendor\consolidation\annotated-command\src\CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#9 C:\wamp64\www\list\vendor\consolidation\annotated-command\src\AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#10 C:\wamp64\www\list\vendor\symfony\console\Command\Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 C:\wamp64\www\list\vendor\symfony\console\Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 C:\wamp64\www\list\vendor\symfony\console\Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 C:\wamp64\www\list\vendor\symfony\console\Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 C:\wamp64\www\list\vendor\drush\drush\src\Runtime\Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 C:\wamp64\www\list\vendor\drush\drush\src\Runtime\Runtime.php(48): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 C:\wamp64\www\list\vendor\drush\drush\drush.php(72): Drush\Runtime\Runtime->run(Array)
#17 C:\wamp64\www\list\vendor\drush\drush\drush(4): require('C:\\wamp64\\www\\l...')
#18 {main}.
Error: Call to a member function setFilterConfig() on null in hashtags_install() (line 12 of C:\wamp64\www\list\modules\contrib\hashtags\hashtags.install).
arlingtonvoicellc’s picture

Ok, I figured my issue out, but I'm thinking I need to open another issue, because it appears to be a bug.

The setFilterConfig() assigns hashtags to basic_html and full_html text format. I have those text formats disabled, however. And apparently that was creating a conflict. So when I enabled the module with Drush, thus the error.

I was able to fix it and remove the error by manually changing the code to match the names of my text formats. However, I know that's not the proper fix. I'll open another issue

pallas athena’s picture

I am curious about the status of this project and the compatibility with Drupal 9^?

umit’s picture

Follow

cuman’s picture

StatusFileSize
new7.12 KB

I don't know how to make patches, so I'm posting files with changes that allow the module to work in D9. You can replace them in your settings and everything will work. If someone makes an official module, that would be great.

But it seems, ckeditor 5 does not to allow using the hashtag filter.

cuman’s picture

StatusFileSize
new280.6 KB

For ckeditor 5:

- *   type = Drupal\filter\Plugin\FilterInterface::TYPE_MARKUP_LANGUAGE,
+ *   type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,

in FilterHashtags.php

cestmoi’s picture

@ramonvasconcelos @bruno.bicudo I'm not sure any patch shared here has any fix for the help page issue. I tested the version posted by @cuman (#14) and while all worked as expected, the help page gave an error still.

alex.amtr’s picture

Hi,
I am working on site on D10.
Is there any chance to make this very useful module working on D10 ?

cestmoi’s picture

@alex.amtr I managed to make it work on Drupal 10.1.1 by just editing the .info.yml file with core_version_requirement: ^8.8 || ^9 || ^10 but you need to install it via UI not via Drush as this may break your site.

Make sure to have a DB backup before installing it as this was the only way I could restore and repeat the install via UI.

I managed to fix all the functional issues I came across on D10 and I just need to test reinstall it using Drush. I then hopefully can create a patch for it and upload.

cestmoi’s picture

I just created a new issue with a complete patch with changes against the latest official release. Please check and test it from here.