Hey all, just came across this issue using Pro v6.3.8 and Envira v1.9.5. Writing in, in case it’s helpful for others as a hot fix.
When editing a gallery, I sometimes came across an issue where I would delete some images, and then try re-add some back in, and nothing would happen other than an infinite “Adding items to gallery” spinning notification.
I did a bit of digging and found that there’s an error in the plugin itself: the bulk delete feature doesn’t work properly. Delting single images is fine, but doing it by bulk is broken.
It’s not advisable to do this, but you can do a hot fix (as we have done) to get it working as it should:
- Open up
/wp-content/plugins/envira-gallery/src/Functions/ajax.php
in a text editor - Navigate to line 512. You’ll see something like:
foreach ( (array) $attach_ids as $attach_id ) {
$has_gallery = get_post_meta( $attach_id, '_eg_has_gallery', true );
- Change it instead to be:
foreach ( (array) $attach_ids as $attach_id ) {
$attach_id = absint($attach_id);
$has_gallery = get_post_meta( $attach_id, '_eg_has_gallery', true );
Please note that changing plugin files directly like this is not usually a good idea. And that any updates to the plugin down the track will override any changes you make.
However @charlie - my hope is that you’d see this, and either pass this issue on to Envira or do a review of the next Envira release as soon as you can (because they may have already fixed it)