gadgetto / GoodNews

An integrated group and newsletter mailing system for MODX Revolution CMF
GNU General Public License v2.0
10 stars 4 forks source link

GoodNews 1.6.x - GoodNewsGetNewsletters+ PHP 8.0.21 #98

Closed 70hundert closed 1 year ago

70hundert commented 1 year ago

Hi there!

I finally switched to PHP 8.0.21 with a MODX v2.8.4 installation, using Goodnews v1.6.1-pl

After the switch my page for the newsletter-archive didn't work anymore. I removed some parts to see where the problem is, and it has been the GoodNewsGetNewsletters-snippet.

In the snippet i had to comment out line 83 to see the webpage at all:

$sorts = array($sortby => $sortdir);

But having commented out this line of code, the newsletters are not getting sorted anymore, which was kinda to expect.

Any hint on how to solve this issue and to make the sorting available again?

Cheers and thanks in advance,

Marc

gadgetto commented 1 year ago

GoodNews 1.x currently doesn't fully support PHP 8+!

To fix the snippet to work with PHP 8+ you need to implement the changes from here: https://github.com/gadgetto/GoodNews/commit/187651f4e55378abd7fb1f180b9fe85bdb18277d

Fixes deprecated PHP each() usage for PHP8+ in snippets (GoodNewsGetNewsletters and GoodNewsContentCollection)!

This is from the next version of GoodNews which will only run on MODX3. There is currently no upgrade path. When 2.x released, I'll throw some work on 1.x version to get it running on PHP 8+

70hundert commented 1 year ago

Thanks a lot, this has helped and fixed the problem!