We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Upgrading issue from EE 2.5 to EE 3.5

How Do I?

MINDSCREEN's avatar
MINDSCREEN
218 posts
8 years ago
MINDSCREEN's avatar MINDSCREEN

Hi During Upgrade, I have got many error for EE2 add-ons and I need to replace that with alternate add-ons or remove those. Now, I face a problem, which I can’t solver, can anyone help?

I am retrieving 1 year previous date from current date with PHP code as below:-

$current_time = $this->EE->localize->decode_date('%Y-%m-%d %H:%i', $this->EE->localize->now - 604800);

Its worked well in EE2, but in EE3, its showing Fatal error: Call to a member function decode_date() on a non-object in /home/mercator/public_html/system/ee/legacy/libraries/Functions.php(680) : eval()’d code on line 1, how can I fix that?

       
Derek Jones's avatar
Derek Jones
7,561 posts
8 years ago
Derek Jones's avatar Derek Jones

Sounds like you are coming from a very very old version. Localization changes in v2.6.0 refactored some of those methods. While this eliminated DST issues, it was before we adopted semver, so I apologize for that code incompatibility.

Localize::decode_date, use Localize::format_date instead.
       
MINDSCREEN's avatar
MINDSCREEN
218 posts
8 years ago
MINDSCREEN's avatar MINDSCREEN

I have fixed it with PHP code as below:-

$current_time=date('Y-m-d', strtotime(' -7 day'));

Now, I have a problem with JSON_Encode plugins used in EE 2.5, can’t find any alternate plugin in EE3? Can you Please help?

       
Derek Jones's avatar
Derek Jones
7,561 posts
8 years ago
Derek Jones's avatar Derek Jones

How and where are you using that PHP?

JSON encoding: https://github.com/tjdraper/JSON-EEncoder

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.