Closed (fixed)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2013 at 21:23 UTC
Updated:
24 Mar 2013 at 17:41 UTC
Jump to comment: Most recent file

Comments
Comment #1
damienmckenna(misread, never mind)
Comment #2
damienmckennaThis action would basically just remove the meta tag records for the selected entities, right?
Comment #3
juampynr commentedHere is a patch that adds a "Bulk revert" tab that shows a form like the following image. For simplicity I started by just supporting nodes, letting the user choose on content types, but this could be extended afterwards to all entities that support metatags.
Comment #4
damienmckennaThanks for working on this. Am pushing it back to Needs Work with the following suggestions:
Comment #5
juampynr commented@DamienMcKenna, thanks for the quick feedback. I will give another stab at this later. I have some code I got rid of at the end for handling all entity/bundles that support metatags.
Comment #6
juampynr commentedHere it is:
* Added hook_help() to be extra verbose on what this task do.
* Now it supports all entity/bundles. However, I had to add a dirty condition so it could revert users. This is related with a pending Drupal 7 bug which is being discussed at #1054168: EntityFieldQuery fails for entities that have no bundle and, although it does not show an error, it returns 0 users if -->entityCondition('bundle', 'user') is set.
Comment #7
damienmckenna@juampy: Very nice! I'll give it a more thorough review tomorrow, but this looks great!
Comment #8
damienmckennaI think this needs one other improvement: an option to select the specific meta tags to be erased. My idea is that it would add a new (required, no default) selector to change between "all meta tags" and "specific meta tags", if the latter option is selected it would show a set of checkboxes to choose the meta tags that are removed. This would also help resolve #1939396: MetaTag doesn't return the default value when field is empty.
Comment #9
damienmckennaLets keep it as-is for now and do a follow-up issue for expanding the reset options.
Comment #10
juampynr commentedAgree! Let me know once it is committed and the new issue is created and I will find some time to work on it.
Comment #11
damienmckennaA few small tweaks inc changing the URL from "revert_bulk" to "bulk-revert".
Comment #12
damienmckennaWe'll also need a follow-on task to generalize the logic so that EntityFieldQuery bug can be handled for all entities.
Comment #13
damienmckenna(doh)
Comment #14
damienmckennaCommitted.
Comment #15
damienmckennaFollow-on issues:
Comment #16
damienmckennaNow that Metatag v7.x-1.0-beta5 is out am closing this to keep the issue queue clean.
Comment #16.0
damienmckennaEmbedded image.