• Resolved mercurydan

    (@mercurydan)


    Im getting errrors in my error logs. I think it has something to do with us upgrading to PHP 8.1.

    2022-12-06T07:13:31+00:00 CRITICAL Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in public_html/wp-content/plugins/zotpress/lib/shortcode/shortcode.request.php:365
    Stack trace:
    #0 public_html/wp-includes/class-wp-hook.php(308): Zotpress_shortcode_request('')
    #1 public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
    #2 public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #3 public_html/wp-admin/admin-ajax.php(203): do_action('wp_ajax_nopriv_...')
    #4 {main}
      thrown in public_html/wp-content/plugins/zotpress/lib/shortcode/shortcode.request.php on line 365
Viewing 15 replies - 1 through 15 (of 21 total)
  • App does not support php 8.x yet.

    Thread Starter mercurydan

    (@mercurydan)

    PHP 7.4 is not supported for security updates anymore, so I have to upgrade to PHP 8.

    Hi
    I’m not a PHP expert, but I managed to run the existing plug-in through an updater app (Rector) to bring it to PHP 8.

    I’ve set up a test site on my local machine and it seems to work there under PHP 8.0.8.

    I make no guarantees and can’t offer support, but if you’d like to try this version and see, here’s the download link (from my personal NAS cloud).

    Let us know how you fare!

    @kfeuerherm i forwarded this by email direct to Katie as well – hopefully this will get us over the current hump?

    @net-buoy As did I. Fingers crossed!!

    (If you’re stuck, you’ve got nothing to lose trying it… I’d appreciate knowing how it goes, as I’ve not upgraded my sites to PHP 8 yet. Also, past experience suggests Katie has limited time so it could be a while.)

    Plugin Author Katie

    (@kseaborn)

    Yes – I’m on semi-hiatus, as per the front page, just updating a couple times a year. I’ve got zero time and this is a free project with no pay or job prospects or kudos or anything in it for me except “this is something the academic community needs and/or finds useful.” So tech savvy people can jump in. Not sure when I’ll have time next.

    I have posted to zotero forum (see separate thread) and will try to see what @kfeuerherm’s tweaks do to my install

    Thanks. Maybe post the link to the provisional code in your Zotero form post?

    Good luck with the testing.

    Mark

    (@codeispoetry)

    In case anyone is interested what @kfeuerherm’s patched version looks like, here is a diff shown in a quick zotpress fork on github. I have no intention of further developing this as I lack the JS/PHP programming skills but I wanted a quick way to see what this automatic tool would change.

    Have to say I’m quite impressed by the rector documentation.

    @codeispoetry Thanks for this. I was wondering what people’s experience was with the patch. I’m not PHP-savvy either (given time I could learn, but time is the big issue!). I’m hoping that this will work for us and that if we have sufficient positive feedback/lack of negative we might get @kseaborn to post it.

    Fingers crossed!!

    Plugin Author Katie

    (@kseaborn)

    Hi all — this week is Zotpress week for me, so I’m looking into the patch atm.

    Plugin Author Katie

    (@kseaborn)

    I used the code posted by @codeispoetry and @kfeuerherm. I had to make several changes due to hidden issues here and there. I’ve tested in PHP 8.0.8 and WP 6.1.1 on my local machine. I’ve posted a preview below; does anyone want to try it (just to be sure) before release (7.3.2)?

    https://github.com/aspirelab/zotpress

    Unfortunately this is the one week (or more) of total unavailability at my end as term starts next week and ‘thanks’ to a new vision issue which began last term, staying on top of my ball has become a real issue.

    I did some tests when I did the conversion and all worked for me, so I think I’ll have to take it on faith that the extra adjustments will be ok. In the unlikely event that I can find the time to look at it, are those changes clearly marked?

    Next point: I understand the semi-hiatus situation so no criticism–but we probably should be finding a way out of that. As noted a few times, I never learned PHP (I belong to the by-gone era of B programming and the like but have tried to update myself as necessary to my immediate work) but would consider looking at it after term end (i.e., April and beyond) though I must note that I’ll be hosting an international conference in June as well. But if I can even reach a level of having a general sense of what’s going on that would be helpful, as there are issues I’ve noticed beyond the PHP version which I’d be interested in looking into.

    So… short version: will try to get more up to speed in April and beyond and we’ll see how that goes. In the meantime, hoping our combined changes will see us through.

    Plugin Author Katie

    (@kseaborn)

    @kfeuerherm Thanks for checking in. Let’s see if others can check it out. I’ve done my normal thorough testing on my local machine with 10s of examples of all the shortcodes, live version and testing, etc. and it’s working for me in PHP 8, so I may just release it this weekend, as beyond that I can’t guarantee when I can work on Zotpress again.

    No worries, Katie. As I say, I’ll see what I can do come the intersession. I have an interest in such things, anyway. It’s just between this, and Swift, and ANTLR, and Grammatical Framework, and… ?? I’m sure you know exactly what I mean.

    Thanks for taking the time to test it. It worked for me, but I don’t use all the features. Deeply appreciated.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘PHP 8.1 errors’ is closed to new replies.