cms icon indicating copy to clipboard operation
cms copied to clipboard

[4.x]: Can't save matrix field because (almost) all asset fields are erroring – without displaying an error

Open gregorydavidjenkins opened this issue 1 year ago • 4 comments

What happened?

Description

When saving a matrix field (with about 20 block types), I get a "Couldn't save field." error and almost all of the asset fields within blocks (which are not new, they have existed for a long time and remain untouched) are erroring.

For each of these asset fields there isn't a corresponding error message within the field settings itself.

At least one asset field is not erroring, the only thing I can see that is different about that one asset field is that my 'Temporary Uploads' volume (which, yes is assigned as the temp assets destination) is not in the list of available options for that particular asset field.

The asset fields that are erroring have that Temporary Uploads volume in the list (but do not, and never have had it selected).

If I go to my asset settings and change the temp asset directory to a local directory, I can go back and save the matrix field as expected, which leads me to believe this has something to do with this update:

https://github.com/craftcms/cms/issues/11405#issuecomment-1905998661

Importantly, I just updated to 4.11.3 and that update would have included the above changes to the way temporary asset directories are handled.

Here is a screenshot of the control panel after clicking save, with one of the erroring asset fields opened up. (again, there isn't any detailed error message within the field)

Local Control Panel · 9 58am · 08-16

Here is a screenshot of the control panel after clicking save, with one of the non-erroring asset fields opened up. The temporary uploads volume isn't in the list of available options.

Local Control Panel

I have cleared the control panel caches.

Craft CMS version

4.11.3

PHP version

8.1.28

Operating system and version

Linux 6.6.32-linuxkit

Database type and version

MySQL 8.0.32

Image driver and version

Imagick 3.7.0 (ImageMagick 7.1.1-13)

Installed plugins and versions

  • Amazon S3 | 2.2.1
  • Blitz | 4.22.0
  • CP Field Inspect | 1.4.4
  • Embedded Assets | 4.1.1
  • Environment Label | 4.0.3
  • Expanded Singles | 2.0.5
  • Feed Me | 5.7.0
  • Formie | 2.1.26
  • Google Maps | 4.5.2
  • Imager X | 4.4.1
  • Incognito Field | 1.3.0
  • KeyChain | 4.0.0
  • MatrixMate | 2.2.1
  • Redactor | 3.1.0
  • Redactor Split | 4.0.0
  • Reverse Relations | 2.0.0
  • SAML Service Provider | 4.3.0
  • SEO Content | 4.1.1
  • SEO Redirects | 4.1.18
  • Smith | 2.0.1
  • Sprig | 2.11.0
  • Translations | 3.2.3
  • Typed link field | 2.1.5
  • UI Element fields | 2.0.3
  • Vite | 4.0.10

gregorydavidjenkins avatar Aug 16 '24 14:08 gregorydavidjenkins

Agree, this does seem related to that change.

Would you be able to send your Composer files and a database backup into [email protected], so we can look into this? Or if not a database backup, then your config/project/ folder?

brandonkelly avatar Aug 18 '24 10:08 brandonkelly

Just sent config/project and composer files in an email.

gregorydavidjenkins avatar Aug 19 '24 18:08 gregorydavidjenkins

For posterity, this was caused by the restricted location source being set to the volume that was also selected as the temporary uploads location. I also raised a PR to make the validation only apply to the visible fields.

i-just avatar Aug 28 '24 07:08 i-just

Thanks, @i-just! Confirming that I was able to save the matrix field (and other asset fields on the project) when I changed their restricted location source to something other than the temporary uploads location.

gregorydavidjenkins avatar Aug 28 '24 13:08 gregorydavidjenkins

Craft 4.12.0 and 5.4.0 are out with that fix. Thanks for the help!

brandonkelly avatar Sep 03 '24 17:09 brandonkelly

Thanks @brandonkelly!

gregorydavidjenkins avatar Sep 03 '24 17:09 gregorydavidjenkins