That's ok, thank you :)
ujarak
Posts
-
502 errors when saving a post — broken recursive call in update_thumbnails.php for 'stack' elements -
502 errors when saving a post — broken recursive call in update_thumbnails.php for 'stack' elementsThanks for the quick response and for looking into it so fast :)
-
502 errors when saving a post — broken recursive call in update_thumbnails.php for 'stack' elementsHi,
I've been getting 502 errors when saving certain projects in the WordPress admin. After digging into the nginx error logs I traced the issue to a PHP warning cascade in
wp-content/themes/lay/updatejson/update_thumbnails.php, lines 428–444:PHP Warning: Trying to access array offset on int in update_thumbnails.php on line 428 PHP Warning: Trying to access array offset on int in update_thumbnails.php on line 429 ... (repeats for every line in the unpack block)The warnings flood the FastCGI response headers until nginx rejects the response with a 502.
Bug cause
update_thumbnail_in_json_recursive()accepts a single$thumb_dataarray as its third parameter. However, thestackbranch calls it passing individual positional arguments instead:else if ($array[$i]['type'] == 'stack' ) { LayUpdateThumbnails::update_thumbnail_in_json_recursive( $array[$i]['cont'], $needsUpdate, $post_id, $permalink, $title, $featuredImgId, $featuredImgUrl, $ar, $sizesArr, ... ); }This means
$thumb_datareceives the value of$post_id(an integer) inside the recursive call. When the function then tries to unpack$thumb_data['post_id'],$thumb_data['permalink'], etc., PHP fires a warning on every single line of the unpack block.For reference, the
carouselandelementgridbranches in the same function call it correctly:else if ($array[$i]['type'] == 'carousel') { LayUpdateThumbnails::update_thumbnail_in_json_recursive( $array[$i]['carousel'], $needsUpdate, $thumb_data ); }Hope this helps. Happy to provide any additional info if needed.
-
carousel height, min, max and clampOk! Thanks for answering :)
I'll try writing a custom css class for now... -
carousel height, min, max and clampHello!
I'm trying to adjust the carousel sizes in my site and It would be great being able to usemin,maxandclampin the fixed height option inside Carousel Size. Is there any current workaround for achieving this or it should be added as a new feature in the addon?
Thanks a lot in advance <3