Jump to content

Multiple images field: only the last image is saved in DB


theoretic
 Share

Recommended Posts

Hi friends! And thanks for Processwire!

I got a very specific issue while working on a Processwire-based project. I have an "images" datafield there. This is a multiple images field, and during the local development it works as intended.

The problem arises in staging / production environment. If I'm trying to upload several images at once, only the info about the last of them is stored in the field_images DB table. It's still possible to upload images one by one, it works fine, but uploading multiple files at once could be more convenient.

Some details:

  • Development and production environments are different. Windows 11/php 8.4.4 for dev, Ubuntu/php 8.4.3 for production. The list of php extensions is also slightly different. But I don't think this may cause the problem.
  • Multiple images upload does not fail. There's no error during upload, the files successfully "land" in their dedicated directories. But the images_field stores only the info about the last upload in the bunch.
  • Processwire version for both dev and prod is 3.0.247 . I also tried some older versions but had the same issue with multiupload.
  • There's no such issue with my "files" field. I can upload several files at once, and all of them will be mentioned in my field_files table.
  • I have at least on hook firing after images upload, but disabling it does not change the situation.

Will be grateful for any advice how to cure this disease )

 

Link to comment
Share on other sites

Sounds strange. Lacking any better ideas/explanations why this could happen, the first thing that I'd try is to install one of the default/blank profiles without any other modules and see if the behaviour is the same. If it is, then you likely have a problem with your server setup. If it works, the problem is probably in one of your modules or templates 🙂 

Or maybe before doing that check from different computers or also different networks to narrow down the issue.

Link to comment
Share on other sites

I agree with bernhard that testing with a simple, undeveloped installation with only a multi-images field configured would be a good test.

If your host uses mod_security and has made any customizations to it, that could potentially be an issue too. (I use Dreamhost and there are multiple issues with its configuration of mod_security and ProcessWire.) Are you running Apache or NGINX? Were there any JavaScript console errors during the interactive process? (I know you mentioned to error during the upload, but unsure what errors your had checked; system logs or JS console or both.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...