Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-07-13 13:02:29

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 205
Website

Image Upload suddenly not working (no rights neither a path problem)

I have the situation here, that the image upload suddenly is not working anymore.
The site is running on TXP 4.8.8. (just update from 4.8.7 hoping that this could solve the problem but it didn´t)

5 days ago all was working fine. Now the upload bar will start and when its on 100% I receive an error message at the bottom that says “An error accurred while saving” (it is in German so thats just my translation).

  • Fileupload works normal though.
  • Changing an existing image into another image works fine (the upload on the image details page)
  • Diagnose does not show any problems.
  • Server quota is not exceeded.
  • PHP Version is 7.3.33.

There are around 750 images so far in the images folder.
No plugin was added or anything else changed in the meantime. At least as far as I can see.
The filesize of my test images is not too big. I am testing jpg and png. Nothing works.

Does anyone have any idea what else to check to find the cause of this issue?

Offline

#2 2022-07-13 13:12:16

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 205
Website

Re: Image Upload suddenly not working (no rights neither a path problem)

Ahh … debug modus shows me now:
User_Error Field ‘jar_image_custom_2‘ doesn’t have a default value

But I am still a bit stuck on that. That does not really explain why it was working all the time and now it doesn´t.
Even if I give the jar_image_custom_2 field a value it does not work.
And even if I deactivate the plugin jcr_image_custom I have still the same error message.
Any ideas?

Last edited by demoncleaner (2022-07-13 13:18:35)

Offline

#3 2022-07-13 17:53:44

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,412
Website

Re: Image Upload suddenly not working (no rights neither a path problem)

Strange. I’ve just tried to reproduce that on a fresh installation, uploading both from the image list pane and from an image edit pane for a specific image, as that’s the only way I can think of that you could set the image custom 2 value (though anything you enter there is lost on uploading anyway). That should not have a bearing on the upload.

Or are you using another upload method?

An idea, though probably a long shot: Can you take a look at your txp_image table in your database? I’m wondering if the default the error is referring to is the default cell value for those columns in the database. When creating a new row in the database, that default value is used when no data is available for a cell, as would be the case with a fresh image.

The plugin installation routine sets DEFAULT '' (as you can see here) meaning an empty string (same principle as the regular article custom fields).

In Sequel Ace you can check that by right clicking on the table and choosing ‘Show create table syntax’. In phpMyAdmin, you put a check mark next to the table and choose the “show create” option from the dropdown at the bottom of the table (see pic in this stack overflow thread). Alternatively, you can execute an sql query with:

SHOW CREATE TABLE `txp_image`

to output the create table syntax. Take a look at what you get and see if your table columns are lacking specifications for the default value for the custom field entries. That might explain it.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2022-07-13 20:00:24

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 205
Website

Re: Image Upload suddenly not working (no rights neither a path problem)

Sorry I just read your answer now. Meanwhile I went into the database and set the default value of the field mentioned above to NULL instead of “nothing” (“keine” german phpmyadmin version). And voila it worked. The client told me that the provider has changed “something” lately on the server. Unfortunately I could not get any more details. Without further investigation I thought that must have been some kind of database update issue that caused the problem.

Thanks a lot for trying to help and getting your head around this. Eventhough I think I did not fully understand your explantion. Wouldn´t the issue just be related to the plugin jar_image_custom in some way? But anyway… Unless it can still help you or others somehow I would not waste any more of your precious time on that problem.

Offline

#5 2022-07-13 20:24:52

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,412
Website

Re: Image Upload suddenly not working (no rights neither a path problem)

Thanks for replying and glad you got it solved. Your solution chooses another value for DEFAULT (“NULL”) than the plugin sets (“” = empty string) but the principle it is addressing is the same: it seems you had no value at all (“keine”) specified as the default, so that is why it was complaining when saving.

My plugin was the origin of the problem, though I’m not quite sure why it arose. Maybe you had a very early version of the plugin where I had forgotten that. I don’t remember.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB