• Tomas Risberg

    (@tomasrisbergsilentse)


    If you try to access the page you will receive this message:

    Backtrace from warning ‘Undefined variable $request_items’ at /home/silent/domains/silent.se/public_html/wp-content/plugins/zotpress/lib/shortcode/shortcode.functions.php 597:

    and so on. If I remove this at that bottom

    [zotpressInTextBib style=”vancouver” sortby=”default” sort=”ASC”]

    the page will load, but with the spinning gears. I have searched all the in-text reference codes, but can not find any of them with obvious errors.

    Anyone here that know what to do for to solve this problem?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Tomas Risberg

    (@tomasrisbergsilentse)

    I have tested and found that removing two references from the page fixed the problem. My host analyzed the problem quickly and they say that there is a restriction in Zotpress, so that you can not have more than 50 references on one page. I had 53. Now there is 51 and the page works.

    Does anyone here know how to adjust this limit? I want to be able to have more than 50 references on this particular page.

    My host sent me this image from a part of Zotpress

    I had a problem in that area of code as well, not quite the same as yours, but it may be related. I worked around it by adding a check to determine whether $request_items was countable. Might be worth a try?

                foreach ( $items as $item ) {
                    if ( is_countable($request_items)) {
                        if ( count($request_items) < 50 ) {
                            $request_items[] = $item;
                        }
                    }
                    else {
                        $requests[] = $request_items;
                        unset( $request_items );
                    }
                }

    I think your hosting company isn’t correct in saying that you can only have 50 references – you still have 51 anyway – and I’ve certainly got pages with way more than 50 references that work fine, such as https://engole.info/a-christmas-carol

    • This reply was modified 1 year, 7 months ago by ericcorbett2.
    Thread Starter Tomas Risberg

    (@tomasrisbergsilentse)

    Thank you! This is most interesting. I can see that you have 121 references at that page!

    When I first wrote to my host I cited a part of the Zotpress FAQ, and it still seems possible my problem is related to a too short timeout at their server:

    “First, check
    with your web host or server admin to make sure that one of cURL, fopen
    with Streams (PHP 5), or fsockopen is enabled. If so, check to see if
    your server has any restrictions on timeouts (Zotpress sometimes needs
    more than 30 seconds to process a request to the Zotero servers).”

    I want to try your code. Can you tell me where in Zotpress to put it?

    Thread Starter Tomas Risberg

    (@tomasrisbergsilentse)

    I tried to add the suggestet code in the shortcode.functions.php file above and then below the code you seen in the image my host sent me. It didn’t solve the problem, but maybe the code should be added somewhere else in Zotpress? (I know nothing about coding.)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Backtrace from warning’ is closed to new replies.