hudlee
Forum Replies Created
-
//Set this in wp-config fixed my issue, now edit thumbnail is never blank define('NGG_DISABLE_DYNAMIC_IMG_URLS', true);I’d like to know why? But this isn’t my site & I don’t use wordpress much so….
The broken url comes from this get_image_url() function in this file:
/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php
function get_image_url($image, $size = 'full') { $retval = NULL; $image_id = is_numeric($image) ? $image : $image->pid; $key = strval($image_id) . $size; $success = TRUE; if (!isset(self::$image_url_cache[$key])) { $url = $this->object->_get_computed_image_url($image, $size); if ($url) { self::$image_url_cache[$key] = $url; $success = TRUE; } else { $success = FALSE; } } if ($success) { $retval = self::$image_url_cache[$key]; } else { $dynthumbs = C_Dynamic_Thumbnails_Manager::get_instance(); if ($dynthumbs->is_size_dynamic($size)) { $params = $dynthumbs->get_params_from_name($size); $retval = $dynthumbs->get_image_url($image, $params); } } return apply_filters('ngg_get_image_url', $retval, $image, $size); }So $this->object->_get_computed_image_url($image, $size); is returning NULL when the edit thumbnail is blank. Because
(defined('NGG_DISABLE_DYNAMIC_IMG_URLS') && constant('NGG_DISABLE_DYNAMIC_IMG_URLS')) == falsewp-content is inside the wordpress root which is /blog, I tried setting this to /blog or blog, didn’t help and broke in another way.
I no longer believe this is a routing issue with nginx!
I installed a fresh version of wordpress and nextgen gallery and edit thumbnails works fine with the same nginx config settings.Just noticed on the live site SOME images in the main gallery work fine with edit thumbnail and most don’t. This is a very old site maybe something in the db is causing this. A working url inside the img tag with id=”imageToEditPreview looks like this:
https://maurydegeofroy.com/blog/wp-content/gallery/art/cache/womeninfilm6.jpg-nggid03549-ngg0dyn-450×350-00f0w010c010r110f110r010t010.jpgThe broken one is not a valid url afaik (maybe valid to some js thats not running but not valid to the php:
https://maurydegeofroy.com/blog/index.php/nextgen-image/564/450×350/af8d4e30d2d4c573f15420e15ba13d92- This reply was modified 3 years, 6 months ago by hudlee.
Edit Thumbnail still blank with define(‘NGG_GALLERY_ROOT_TYPE’, ‘content’);
404 /blog/index.php/nextgen-image/564/450×350/af8d4e30d2d4c573f15420e15ba13d92
Do i need to redirect this request to somewhere else so that the request finds it’s controller? Or is this the correct url and I am redirecting it away from its controller my mistake.
Where is the controller… is this it?
/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/dynamic_thumbnails/package.module.dynamic_thumbnails.phpBeen years so I don’t remember why I have these try_files lines in the nginx site config:
location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /blog/index.php?q=$uri&$args; } location ~* \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php8.1-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; include fastcgi_params; }No hosting provider, just me @ Imagely.
Using nginx on ubuntu LTS 22.04 with php 8.1.2
Looking for a direction of what I need to fix.
If I need to learn how url routing works in wordpress to iluminate this I’m willing.