metered_timed sets content with this field value to 'premium' on the basis of a comparision between the node's creation date and the cutoff date a set number of days in the past.

It is not working for me because the variable $must_be_created_before contains a date in the Y-m-d format, and the comparison is on the the node created date which is a unix timestamp. The fix is to change content_paywall.module 122 from

$must_be_created_before = date('Y-m-d', time() - ($time_until_moved_to_premium * 84600));

to

$must_be_created_before = date('U', time() - ($time_until_moved_to_premium * 84600));

so that $must_be_created_before contains a unix timestamp.

Comments

John_B created an issue. See original summary.

  • glass.dimly committed 4d9719e on 7.x-1.x
    Issue #2937384 by John_B: Fix metered_timed content by using timestamp.
    
glass.dimly’s picture

Version: 7.x-1.x-dev » 7.x-1.3

Whoops!

Maybe I fixed this for the client but never backported this to the module?

Thank you for this. Your fix has been committed.

glass.dimly’s picture

Status: Active » Fixed
glass.dimly’s picture

Status: Fixed » Closed (fixed)