Option to bulk update metatags

Created on 17 January 2024, 11 months ago
Updated 1 July 2024, 6 months ago

It would be nice if we have an option to bulk update metatags.

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India venkatesh rajan.j

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @venkatesh rajan.j
  • 🇺🇸United States platinum1

    +1
    This would be very helpful for existing sites.

  • Assigned to darkdim
  • Issue was unassigned.
  • Status changed to Needs review 11 months ago
  • Merge request !3Draft: Resolve #3415243 "Option to bulk" → (Closed) created by darkdim
  • Please add instructions regarding your solution and how it can be tested.

  • 🇺🇦Ukraine darkdim Kyiv

    Please add instructions regarding your solution and how it can be tested.

    Yes, I will do it.
    I'm not sure if the permissions have been added correctly. We can discuss this.

  • 🇺🇦Ukraine darkdim Kyiv
    1. Apply patch
    2. run update db
    3. action will be added, on /admin/content page check any nodes and get action 'Generate metatag' from drop-down list
    4. metatags will only be processed for the specified types in /admin/config/content/metatag-ai/content-type
  • 🇺🇦Ukraine darkdim Kyiv

    added di container

  • 🇺🇦Ukraine darkdim Kyiv

    some upgrade

  • 🇺🇦Ukraine darkdim Kyiv

    darkdim changed the visibility of the branch 3415243-option-to-bulk to hidden.

  • 🇺🇦Ukraine darkdim Kyiv

    darkdim changed the visibility of the branch 3415243-option-to-bulk to hidden.

  • 🇵🇭Philippines paraderojether

    Hi @darkdim,

    I reviewed patch #16, and the patch did not apply successfully, I got the error below when applying the patch:

    jetherparadero@PrometSources-MacBook-Pro metatag_ai % curl https://www.drupal.org/files/issues/2024-01-31/3415243-option_to_bulk_update_metatags_1.patch | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  8397  100  8397    0     0  12650      0 --:--:-- --:--:-- --:--:-- 12780
    Checking patch web/modules/contrib/metatag_ai/metatag_ai.module...
    Checking patch web/modules/contrib/metatag_ai/metatag_ai.install...
    Checking patch web/modules/contrib/metatag_ai/src/Plugin/Action/GenerateMetatagAction.php...
    Checking patch web/modules/contrib/metatag_ai/src/Plugin/GenerateMetatag.php...
    error: while searching for:
    namespace Drupal\metatag_ai\Plugin;
    
    use Drupal\Core\Config\ConfigFactoryInterface;
    use Drupal\Core\Logger\LoggerChannelFactoryInterface;
    use Drupal\Core\State\State;
    use GuzzleHttp\Client;
    
    error: patch failed: web/modules/contrib/metatag_ai/src/Plugin/GenerateMetatag.php:3
    error: web/modules/contrib/metatag_ai/src/Plugin/GenerateMetatag.php: patch does not apply
    Checking patch web/modules/contrib/metatag_ai/config/install/system.action.generate_metatag_action.yml...

    I would also like to suggest creating a merge request so that will be easy for the maintainers to check the code.

    Kindly check and advise, please.
    Thankyou

  • Status changed to Needs work 10 months ago
  • Status changed to Needs review 9 months ago
  • Merge request !6Resolve #3415243 "Bulk update" → (Open) created by darkdim
  • 🇺🇦Ukraine darkdim Kyiv

    darkdim changed the visibility of the branch 3415243- to hidden.

  • Status changed to Needs work 7 months ago
  • 🇵🇭Philippines kenyoOwen

    Hi darkdim

    I applied your patch and it works, but when I run fin drush cr and fin drush updb I got this error and vice versa fin drush updb and fin drush cr.

     ------------ ----------- --------------- -------------------------------------
      Module       Update ID   Type            Description
     ------------ ----------- --------------- -------------------------------------
      metatag_ai   10101       hook_update_n   10101 - Implements hook_update_N().
     ------------ ----------- --------------- -------------------------------------
    
    
     Do you wish to run the specified pending updates? (yes/no) [yes]:
     > yes
    
    >  [notice] Update started: metatag_ai_update_10101
    >  [error]  The "generate_metatag_action" plugin does not exist. Valid plugin IDs for Drupal\Core\Action\ActionManager are: comment_unpublish_by_keyword_action, node_unpromote_action, node_unpublish_by_keyword_action, node_assign_owner_action, node_promote_action, node_make_sticky_action, node_make_unsticky_action, user_cancel_user_action, user_unblock_user_action, user_block_user_action, user_remove_role_action, user_add_role_action, action_send_email_action, entity:save_action:block_content, entity:save_action:comment, entity:save_action:file, entity:save_action:menu_link_content, entity:save_action:node, entity:save_action:taxonomy_term, entity:save_action:user, entity:unpublish_action:block_content, entity:unpublish_action:comment, entity:unpublish_action:menu_link_content, entity:unpublish_action:node, entity:unpublish_action:path_alias, entity:unpublish_action:taxonomy_term, entity:publish_action:block_content, entity:publish_action:comment, entity:publish_action:menu_link_content, entity:publish_action:node, entity:publish_action:path_alias, entity:publish_action:taxonomy_term, action_goto_action, action_message_action, entity:delete_action:comment, entity:delete_action:node
    >  [error]  Update failed: metatag_ai_update_10101
     [error]  Update aborted by: metatag_ai_update_10101
     [error]  Finished performing updates.

    Basically what I did before applying your patch is add a metatag field to the basic page content type. My Drupal local is newly generated and also tested your patch wherein I only enabled the Metatag and Metatag AI generator and got the same error, tested another fin drush updb with all the metatag modules are enabled. Please correct me if what I did is wrong to get the error.

    Thanks,
    Ken.

  • 🇫🇷France chipway

    Tested today on Drupal 10.2.7 and PHP 8.3.

    Patch applies, Generate metatag Action appears and do the job.

    I just got 2 Error messages after running Bulk updates:
    • Deprecated function: Creation of dynamic property Drupal\metatag_ai\Plugin\GenerateMetatag::$state is deprecated in Drupal\metatag_ai\Plugin\GenerateMetatag->__construct() (line 70 of modules/contrib/metatag_ai/src/Plugin/GenerateMetatag.php).
    • Deprecated function: Creation of dynamic property Drupal\metatag_ai\Plugin\Openai::$state is deprecated in Drupal\metatag_ai\Plugin\Openai->__construct() (line 71 of modules/contrib/metatag_ai/src/Plugin/Openai.php).

    Bulk generation helps a lot.

  • Status changed to Needs review 6 months ago
  • 🇵🇭Philippines kenyoOwen

    I was able to fix the generated metatag action issue.
    Please review.

  • First commit to issue fork.
  • Pipeline finished with Success
    6 months ago
    Total: 142s
    #212920
Production build 0.71.5 2024