Sopme way to process existing nodes when installing premium.module?

budda - February 9, 2007 - 16:56
Project:Premium
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Would be useful if there was a way to batch process nodes to apply premium restrictions to them based on their created date?

#1

Allie Micka - August 21, 2007 - 17:30
Version:4.7.x-1.x-dev» HEAD
Status:active» postponed

I would accept a patch that effects this when the premium settings are changed.

#2

jerdavis - July 13, 2008 - 01:36
Status:postponed» needs review

I've created a patch which will address this. The attached patch uses hook_node_operations() to add a "Make Premium" and "Remove Premium" option on admin/content/node. These options will allow you to select existing nodes and set/remove premium status on those nodes as a bulk operation.

This can be used to make existing nodes premium, without having to edit each one individually.

I've tested the patch locally on d5 and everything seems to be working properly. The patch was made with a CVS Diff of HEAD.

Let me know if there are any issues!

Jer

AttachmentSize
premium_bulk_set.patch 2.41 KB

#3

jerdavis - July 30, 2008 - 05:06

In addition to the previous patch, here is a patch which addresses the needs you described above. This patch adds a few things to admin/settings/premium. First, there is the ability to set "premium-ness" for existing node types directly from the admin interface. Additionally, you can check a box which allows you to update all nodes based on the current premium admin settings.

When a user first downloads and installs premium, they simply go to admin/settings/premium, pick which node types they would like to make premium, check the box to bulk update nodes and all existing nodes of the types selected will be made premium based on the current admin form settings.

AttachmentSize
premium_admin.patch 3.38 KB

#4

Allie Micka - August 3, 2008 - 03:23
Status:needs review» fixed

Thanks jerdavis!

Committed both patches.

#5

Anonymous (not verified) - August 17, 2008 - 03:23
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.