All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: {speedy:set_ttl} gives “Failed to parse time string” error

Status Resolved
Add-on / Version Speedy 1.7.0
Severity
EE Version 7.1.6 pro

University Communications

Dec 17, 2022

I tried using {speedy:set_ttl}{expiration_date}{/speedy:set_ttl} as the docs say that timestamps are acceptable, but it gives the following error:

DateTime::modify(): Failed to parse time string ({expiration_date}) at position 0 ({): Unexpected character
user/addons/speedy/mod.speedy.php, line 417

The code on line 417 is executing the !is_numeric conditional. I even tried hardcoding a number between the tags but it gives the same error.
Thank you!

#1

BoldMinded (Brian)

Sounds like {expiration_date} is not parsed, so Speedy is getting the actual value of “{expiration_date}”, not a numeric timestamp. Did you try putting in a numeric timestamp instead of the {expiration_date} variable to test it?

#2

BoldMinded (Brian)

I even tried hardcoding a number between the tags but it gives the same error.

Never mind, I didn’t fully read your comment. Can you please share more of your template code? I can’t diagnose this without more context. I also need to try to replicate locally what you’re doing.

#3

University Communications

Sure, here’s the part of the template that’s being cached:

{exp:speedy:fragment driver="file" key="frag"}
 {exp:channel:entries
  channel="news_releases|features|story"
  limit="1"
  show_future_entries="yes"
  dynamic="yes"
  require_entry="yes"
  status="Open|Draft"
  disable="member_data|pagination|category_fields"
 }

  {modules_feature-detail-hero}
  {modules_feature-detail-wysiwyg}

 {/exp:channel:entries}

 {modules_you-may-also-like}
 {modules_subscribe}
 {embed="embeds/_bottom"}
{/exp:speedy:fragment}

And the {modules_feature-detail-hero} partial has this code at the very top of the file containing the {speedy:set_ttl} tag:

{if "{entry_date format='%U'}" > "{current_time format='%U'}"}
 {speedy:set_ttl}{entry_date}{/speedy:set_ttl}
 <div class="alert alert-danger embargo" role="alert">
  <div class="container">
   TEST: {entry_date} | This is an <strong>EMBARGOED</strong> news release for distribution on {entry_date format="%F %d, %Y - %g:%i%a"} PST. Do not share or link to this page.
  </div>
 </div>
{/if}
#4

BoldMinded (Brian)

Due to the upcoming holidays it could be a week or two before I have time to dig into this.

#5

BoldMinded (Brian)

Did you try using this take outside of the partial and putting it directly into the entries tag?

#6

University Communications

Yes, I did try that as well. I’ll be out on holiday for two weeks as well fyi. Thanks!

#7

BoldMinded (Brian)

I forgot to update you yesterday but I think I have it fixed so I’ll post a build when I get a chance.

#8

BoldMinded (Brian)

Comment has been marked private.

#9

University Communications

Comment has been marked private.

#10

BoldMinded (Brian)

Comment has been marked private.

#11

University Communications

Comment has been marked private.

Login to reply