infoField Problem
4 posts by 4 authors in: Forums > CMS Builder
Last Post: June 11 (RSS)
On 3.77, I have a schema with image upload. For info1 I have named it "Alt Text" and I have erased info2 "Caption"
The problem is that when I save it, info2 "Caption" comes back and won't erase. I thought to myself, I would just go in and manually update the schema file, but I don't see "info2" or "Caption" listed
'images' => [
'label' => 'Images',
'type' => 'upload',
'allowedExtensions' => 'jpg,jpeg,png,webp',
'checkMaxUploadSize' => '1',
'maxUploadSizeKB' => '5120',
'checkMaxUploads' => '1',
'maxUploads' => '50',
'resizeOversizedImages' => '1',
'maxImageHeight' => '1080',
'maxImageWidth' => '1080',
'createThumbnails' => '1',
'maxThumbnailHeight' => '500',
'maxThumbnailWidth' => '500',
'helpMessage' => '1080x1080 pixels preferred',
'createThumbnails2' => '1',
'maxThumbnailHeight2' => '250',
'maxThumbnailWidth2' => '250',
'newUploadPosition' => 'bottom',
'infoField1' => 'Alt Text',
'infoField1Required' => '1',
'useCustomUploadDir' => '1',
'customUploadDir' => 'listings/',
'customUploadUrl' => '/xxxxxxxxx/uploads/listings/',
],
Follow-up: after further review, the "Caption" does appear in the Info2 field after I delete and save, but it is not showing up when I upload images. It's more of a housekeeping issue because it doesn't cause any problems, but it does reappear if I save the schema without removing it first each time I want to modify the schema.
Hi Kenny,
I was able to recreate what you are seeing and what is happening is that their are some defaults in the system that get overwritten by what is in the schema file on load. In the case of infoField2, there is a default of "Caption" that when it reads the schema and sees no infoField2 it will not overwrite this default "Caption" value and so it reappears.
This will cause the problem you are seeing where if you don't remember to clear that field each time, eventually the default value makes its way back into the schema and becomes visible again. I will outline the issue to Dave and so he can put it into the next version as a fix.
Thanks for the report!
Senior Web Programmer
Interactivetools.com