Closed (fixed)
Project:
Views Bulk Operations (VBO)
Version:
6.x-1.x-dev
Component:
Actions
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
21 Jul 2009 at 10:38 UTC
Updated:
10 Jun 2011 at 03:48 UTC
Jump to comment: Most recent
Comments
Comment #1
infojunkieUse the action "Modify node fields". In the action form, check the box in front of "Authored on: " and enter the date/time you desire.
Comment #3
sean_a commentedI only see the option to change cck fields when I do this. The publish date isn't listed as an option.
Comment #4
infojunkieThat's true, I removed the option to edit non-CCK fields in the "Modify node fields" action. I'll keep this as a feature request.
Comment #5
sean_a commentedThanks for adding back the request. Is there a way to add back the option from a previous version or will it need to be reworked? I'm happy to help if you can let me know which version had it.
Comment #6
infojunkieI think 6.x-1.8 should have it.
Comment #7
seanemmett commentedAnother vote for restoring non-CCK fields. I'd also like to modify post date in batches. Cheers.
Comment #8
infojunkieFields needed so far:
* Publishing date
* Language
Comment #9
hansrossel commented+1 from me, thanks a lot. Need to change created date and language.
Comment #10
eiland commentedsubscribe
Comment #11
seanemmett commentedI've been successful in editing post dates in bulk, by going back to VBO 6.x-1.8. Woo hoo!
My only disappointment is that in changing the date, I'm also changing the time. I upload my image nodes in a particular order so they'll display chronologically but this order is lost when the new post date is applied.
The syntax I'm employing in the code box:
$node->created = unixtimestamp;but this resets the post date and time for all selected nodes to be the same.
Is there way to change just the date portion of the original timestamp without affecting the time portion?
That would be grand!
Comment #12
infojunkieThanks for the info, but I think people would rather see the feature in future versions of VBO, rather than revert to older versions.
I'll keep your separation of date/time in mind.
Comment #13
seanemmett commentedFor sure. I was just hoping someone might help me out with better snippet of code in the meantime as I worked out my backlog.
That would be great to see that feature in a future release. Thanks.
Comment #14
seanemmett commentedI stumbled upon a solution to my problem of changing dates without affecting time, not very elegant, but it works for a PHP nudnick like me.
Sharing here for the record:
$node->created = $node->created - (x * 24 * 60 * 60);where x is the number of days I need to turn the clock back to back-date my posts.
Thanks for your help with this and your ongoing development of VBO; hope the ability to modify node fields will be restored in a future release.
Comment #16
draks commentedI actually have a need to batch change the Title and Body fields as well for a large set of image nodes. I could work around this by creating two CCK fields for title and body but this then makes the editing of the node confusing for the end user.
Comment #17
infojunkieTo anyone who wants to modify non-CCK fields: for the time being, the best way to do this is to use the "Execute arbitrary PHP script" action. For example, to change the title, select this action and write something like the following in the script area:
I have yet to figure out a clean way to allow modification of non-CCK fields.
Comment #18
Shai commentedsubscribing
Comment #19
lolandese commentedSubscribing. My use case, to change a nodes language from Neutral to a specific one. How would the code from #17 be?
Comment #20
gggdrpl commentedWith suggestions from #14 and #17 I was able to easily modify the post date of many nodes at the same time without taking back the version I have installed of this module. Thanks a lot!!!
Comment #21
hansrossel commented#19 you can use http://drupal.org/project/languageassign, no need for VBO for this specific question.
Comment #22
infojunkieRe #19: Here's the code to use with VBO:
Comment #23
lolandese commentedTried both. Thanks to both of you. For others with the same need:
Use #22 if you don't want to install another module.
For #21, see the use cases in the Language assignment project description. You can still disable it afterwards if you don't get much new content. I noticed it plays well with VBO. To quote the module description:
"If VBO is installed, then a "Set language" operation will also become available in your bulk operation-style views."
Comment #24
infojunkieRe #23: Thanks for the info about the interaction of Language assignment with VBO. I'll update the complementary modules documentation to reflect this.
Comment #26
restyler commentedI think that modifying non-cck fields is really a must-have feature. It looks like I will have to hack vbo to add ubercart price and node created fields to 'modify fields' window by myself today. Subscribing!
Comment #27
infojunkieI just committed a new approach to handle non-CCK fields. Whoever is still interested, please try it and feedback here.
Currently, only the title is enabled. I will try to add most other common node fields, but this new approach allows 3rd party modules to define their own, non-CCK fields that can appear in "Modify node fields", using the new hook
hook_views_bulk_operations_fields(implemented in fields.action.inc).Comment #28
geerlingguy commented@infojunkie - is there a patch, or is this in a dev release?
Comment #29
infojunkieIt's in the dev. Since the message, I've added support for a bunch of other core Drupal fields.
Comment #30
geerlingguy commentedIt looks like the new options are working perfectly - this is an awesome update!
Only thing I still wish I could do is use tokens when modifying node fields. I would like to update a ton of profile fields, but I don't want to have to do it with PHP code. I'd rather just update the Node: Title field and add [author:realname] :)
I used the following with the 'Execute arbitrary PHP script' to update all my content profile nodes with the author's username in the node title field:
If I could use tokens with the 'update node fields' action, I could just enter
[author:realname]'s Profilein the Title field, and that would be that. But I can live with the above custom PHP...Comment #31
infojunkieTokens are active inside the node fields. This doesn't work for you?
Comment #32
geerlingguy commentedIt didn't seem to work for me in the 'Node Title' field. I haven't tested with any other fields. Nowhere on the action page did I see a Tokens section where I could find what tokens were available to use, though...
Token module works for me on my site with the Rules module and elsewhere.
Comment #33
infojunkieIt's working for me here... Please make sure you have the very latest dev. In the VBO style settings, in the "Modify node fields" section at the bottom of the page, do you see a "Show available tokens" option? Turn it ON to see the tokens on the action page.
Comment #34
timmeh commentedi'm using the latest dev version on drupal 6.19. how do i access non-cck fields? i have them listed in the fields section of the view, and when i "Modify node fields" i dont see the non-cck fields (not even the title), all i see are the custom cck fields we added to our ubercart products.
Comment #35
Rhicreate commentedGreat - really seeing the benefit of VBO when it allows me to change all languages & postdates at the moment using these snippets, interested in what happens with this so subscribing, although the snippet provided works a charm.
Comment #36
YK85 commentedsubscribing
Comment #37
veeray commentedI have installed latest dev. for drupal 6. I'm still not able to bulk edit location fields.
Comment #38
phyadmin commentedWhen will this feature of the dev branch be merged into a release? This feature request was posted in July 2009. It was apparently working by December 2010. It is now May 2011. Last "stable" version was in October of last year. Please merge soon.
Comment #39
infojunkieMarking as fixed. I hope to make a new VBO release when I get some more feedback on the latest dev, where significant code has changed.
Comment #41
asb commentedviews_bulk_operations 6.x-1.x-dev from 2011-Jun-09 is working very well for me for adjusting the node creation date. I have no objections against a new stable release ;)
Comment #42
infojunkie@asb: hint hint nudge nudge.