#3301 - Using 'An uploaded picture' CPF, getting stack trace when saving profile.

Identifier #3301
Issue type Minor issue (breaks specific functionality)
Title Using 'An uploaded picture' CPF, getting stack trace when saving profile.
Status Completed
Handling member Chris Graham
Addon cns_cpfs
Description I added a new CPF of type 'An uploaded picture'. After adding this new CPF, going to a profile will have this new CPF blank, as expected. Using the Profile Edit tab, adding an image and saving the profile results in a stack trace stating illegal string offset 'cv_value' line 200 in sources/hooks/systems/fields/picture.php.

Additionally, blanking (not uploading an image) in the Profile Edit tab resulted in an illegal string offset 'cv_value' on line 197 of picture.php.

Also getting the same errors in same function in picture_multi.php as well. Not tested, but I believe the same errors may also occur in the similar CPF upload types (files, videos, etc.).

Steps to reproduce

Additional information The endpoint of the problem is in the inputted_to_field_value function. A couple of tests I did showed inputted_to_field_value function $old_value parameter isn't getting the array it is expecting. It just gets passed a simple variable that contains the picture file pathname, so there is no cv_value array element. Similarly, the same function in picture_multi.php is getting an array, but not in the expected format that includes the cv_value array element. I'm thinking the actual problem is a bit further upstream from here and affects additional CPF upload types.
Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated