Doesn't work with the Image module

heshanmw - December 13, 2008 - 11:49
Project:Premium
Version:5.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

When I try to create image node with the "Access restricted for non-premium users" is enabled, image is successfully saved but when click on the edit button I can see "Access restricted for non-premium users" is no longer enable. I think the info will enough you to get an idea.
Thanks

#1

heshanmw - December 14, 2008 - 15:12

I found a small error in the premium module, and could fix it, since I do not have a CVS account I cannot commit. Some one must do this as soon as possible cause this is a crtical error.
Error:
When you at the Premium admin settings page you can select multiple node types to update them as premium nodes. For me I select multiple node types including page , story , image and video and check the "Bulk update premium status" too, for my case page was at the top, so in the $types array the very first element was page. I saw that only page nodes were correctly work with the Premium functionality while other doesn't.

Fix :

To work function with other nodes I have to move the simple piece of code. In the "premium_settings_save()" function you can see

$start = $end = 0;
_premium_offset(0, $start, $end, $mode, $count, $unit);

Move then in to the

foreach ($premium_types as $type) { ...

That's all .

I hope this will work for you.
Thanks

#2

heshanmw - December 16, 2008 - 23:56
Assigned to:Anonymous» heshanmw

Ticked assign to me and will fix the bug.

#3

heshanmw - December 17, 2008 - 00:00
Assigned to:heshanmw» Anonymous

Seems i cannot commit changes. :p

#4

Allie Micka - December 17, 2008 - 00:12

Commit access is for folks who have demonstrated:

a) Working knowledge of the process of submitting patches to the issue queue
b) Interest in supporting a project overall, answering support questions and reviewing others' patches.

There's documentation on this site for the above.

If someone submits a patch here we'll try to look at it and apply it.

Thanks!

#5

jerdavis - January 13, 2009 - 18:20
Status:active» won't fix

I fail to see how this change could have anything to do with an issue you say you're experiencing. The line where _premium_offset() is being called is establishing a time offset in seconds to apply to the created date of the nodes during bulk updating. The values it generates are applicable throughout the foreach() loop, there's no reason to call it repeatedly.

If you have any other information, please let me know.

#6

jerdavis - January 13, 2009 - 18:47
Status:won't fix» fixed

Woops! On third or fourth glance I caught how this was being affected. This is now corrected and I'll be committing the changes shortly.

#7

System Message - January 27, 2009 - 18:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.