Bug#1001804: Image preview not available in wordpress

2021-12-17 Thread Craig Small
On Fri, 17 Dec 2021 at 18:59, Katharina Drexel 
wrote:

> I have configured the WP_CONTENT_DIR variable, in wp-config.php as well as
> in
> config-.php. Nevertheless I can reproduce the problem:
> Deleting symlink: no image preview
> Adding symlink: image preview working

That sounds like something else is the problem, possibly a plugin. Some
plugins are badly written and don't use the functions to get the correct
directory but assume a directory layout.

I run an AppArmor profile over WordPress which doesn't allow it to write to
anything under /usr. I'm not getting any hits on that so it's not even
trying.

The trick now is to work out why it's fine here, but not elsewhere. When
you say preview, what exactly is that?  Is it all the small images you see
in the media library? Are the images uploaded into the /var directory but
just not visible? That would point to an apache configuration problem.

 - Craig


Bug#1001804: Image preview not available in wordpress

2021-12-16 Thread Craig Small
On Fri, 17 Dec 2021 at 02:57, Katharina Drexel 
wrote:

> with the actual debian installation, wordpress shows no preview of uploaded
> images, neither in the media nor in the post.
> +   # Symlink needded, otherwise no image preview
> +   ln -s /var/lib/wordpress/wp-content/uploads
> /usr/share/wordpress/wp-content/uploads
>
This would be a bad idea, you are linking a read/write section with the
read-only section.
Files should be uploading to /var/lib/wordpress/wp-content/uploads
including the uploaded image.

I just tried one then, I have files in
/var/lib/wordpress/wp-content/uploads/2021/12

WordPress should be uploading them to ${WP_CONTENT_DIR}/uploads and
WP_CONTENT_DIR is set to /var/lib/wordpress/wp-content in
/etc/wordpress/config-default.php

 - Craig


Bug#1001804: Image preview not available in wordpress

2021-12-16 Thread Katharina Drexel
Package: wordpress
Version: 5.8.1+dfsg1-2
Severity: normal

Hello,

with the actual debian installation, wordpress shows no preview of uploaded
images, neither in the media nor in the post. 

The fix for that would be
--- a/debian/wordpress.postinst
+++ b/debian/wordpress.postinst
@@ -16,6 +16,9 @@ case "$1" in
if [ -f "$APP_PROFILE" ] && aa-status --enabled 2>/dev/null; then
apparmor_parser -rTW "$APP_PROFILE" || true
fi
+
+   # Symlink needded, otherwise no image preview
+   ln -s /var/lib/wordpress/wp-content/uploads 
/usr/share/wordpress/wp-content/uploads
;;
 esac

(MR coming soon)

Greetings
Katharina

-- 
Berner Fachhochschule / Bern University of Applied Sciences
IT-Services / Team Linux & Infrastructure Services
Katharina Drexel
IT System Engineer