• Resolved timbearcub

    (@timbearcub)


    I am using the gallery dynamically with tags from Medla Library Categories plugin with a shortcode, e.g.

    [gallery category="image-forsale" order="DESC" orderby="post_date"]

    It was working fine, but I’ve noticed some of the galleries now give this error, usually the larger galleries?

    Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /wp-includes/formatting.php:3501 Stack trace: #0 /wp-includes/class-wp-hook.php(310): convert_smilies() #1 /wp-includes/plugin.php(205): WP_Hook->apply_filters() #2 /wp-includes/blocks/post-content.php(54): apply_filters() #3 /wp-includes/class-wp-block.php(258): render_block_core_post_content() #4 /wp-includes/class-wp-block.php(244): WP_Block->render() #5 /wp-includes/blocks.php(1133): WP_Block->render() #6 /wp-includes/blocks.php(1171): render_block() #7 /wp-includes/block-template.php(231): do_blocks() #8 /wp-includes/template-canvas.php(12): get_the_block_template_html() #9 /wp-includes/template-loader.php(106): include(‘…’) #10 /wp-blog-header.php(19): require_once(‘…’) #11 /index.php(17): require(‘…’) #12 {main} thrown in /wp-includes/formatting.php on line 3501

    (edited out my /var/www etc server paths for security)

    If I disable all plugins, page shows fine, no gallery though. If I just disable Meow Gallery, it shows, but annoyingly not in columns, but shows the gallery shortcode is working. Disable all but those two plugins, still errors. Changing the theme to a non block theme like Twenty Twenty Two standard still errors. So I think this is caused by Meow Gallery?

    Using PHP 8.0 on nginx, everything else seems fine.

    • This topic was modified 1 year, 1 month ago by timbearcub.
    • This topic was modified 1 year, 1 month ago by timbearcub.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter timbearcub

    (@timbearcub)

    P.S. if it seems to be working now, it isn’t, as temporarily I’ve had to completely remove Meow Gallery and replace all the shortcodes with the Media Library Assistant gallery, not as good but I can’t have the pages broken like that.

    It’s a temporary measure, and I’d like to get Meow Gallery to work, but I don’t know if a response is going to take days or weeks, so I need something to at least be working in the meantime.

    Also what’s with the standard WP Gallery Shortcode? It’s broken, it doesn’t have columns anymore!

    • This reply was modified 1 year, 1 month ago by timbearcub.
    Thread Starter timbearcub

    (@timbearcub)

    I fixed it – kinda.

    The error still remains, but it seems that the problem for Gallery AND Lightbox is if you have a gallery for more than 500 images – I know one that broke was 687 and another was 514, so guessing somewhere around that – then if Meow Gallery is enabled it kicks out that error.and you don’t see the page, just get a ‘critical error’ if PHP errors are disabled – and you can’t edit that page either!

    And Meow Lightbox stops working on that gallery even if Meow Gallery is disabled, links open directly in the browser on a >500 image gallery, smaller galleries work fine

    I kind of fixed it with Media Library Assistant; using pagination means both started working again, and then using mla_alt_shortcode=gallery as per a post here https://www.ads-software.com/support/topic/using-mla-with-meow-gallery/ meant then Meow Gallery could see it, not freak out at the large gallery, and then use the tiling and Lighbox started working again for those two large galleries. Phew – I was dreading trying to use another plugin cos it’s mean having to retag over 2,600 images.

    Not totally happy about using MLA cos it does weird things to my Media Library view, and I don’t like running two plugins for my gallery, but it’s better than nothing.

    Error still remains though – MG and ML doesn’t like galleries bigger than 500 or so images, seemingly.

    • This reply was modified 1 year, 1 month ago by timbearcub.
    • This reply was modified 1 year, 1 month ago by timbearcub.
    • This reply was modified 1 year, 1 month ago by timbearcub.
    • This reply was modified 1 year, 1 month ago by timbearcub.
    • This reply was modified 1 year, 1 month ago by timbearcub.
    • This reply was modified 1 year, 1 month ago by timbearcub.
    Plugin Support Val Meow

    (@valwa)

    Hey @timbearcub !

    I was able to replicate your issue with a gallery of 550 images. It seems the issue is arising from how the block is generated. Thank you for reporting this issue; we will definitely look into it. By the way, if you use the Infinite Scroll feature, it should solve the problem, although it should work in both cases to begin with. ??

    Thread Starter timbearcub

    (@timbearcub)

    Glad to be of help! Love the gallery and lightbox, so was glad I found a partial solution to this, I hope a fix is forthcoming soon. I do actually like my paginated galleries, would be great if MG had that function too so I didn’t need to rely on MLA, but it works.

    Thanks.

    Plugin Support Val Meow

    (@valwa)

    Hey @timbearcub !

    I’ve been investigating this issue, and here is what I’ve found. WordPress verifies the HTML of loaded pages to convert content with text smilies to images. To achieve this, WordPress uses an “ungreedy” regular expression. The use of the “ungreedy” parameter causes the backtrack limit to be exhausted quickly, especially when dealing with long strings. This becomes apparent, for example, when processing a gallery with over 500 meta data entries simultaneously. If you manually remove this “ungreedy” parameter, the process works as intended.

    Since modifying WordPress files is not recommended as updates will erase changes, you can address this issue by adjusting the backtrack limit in your PHP settings. To do this, add the following line to your php.ini file: pcre.backtrack_limit=1000000000. It’s essential to exercise caution when increasing the backtrack limit, and for this particular use case, it might be more suitable to use features such as infinite loading or pagination, as you’re already doing.

    Hope this helps ! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal error: Uncaught TypeError: count():’ is closed to new replies.