I migrated my some contacts from another crm so I decide use their id for contact id in suitecrm
Also I migrated my image for contacts avatar prepared there for suitecrm image stored like idContact_photo, and move those to /upload. Sure I updated MySQL like update contactssetphoto='zcrm_3111820000006915042_photo' where id = 'zcrm_3111820000006915042';
But my photo not appear
But it works well if I try to check with the default contact id like “102bcdff-de19-685f-42f0-5f04449bab52”
I created-moved 102bcdff-de19-685f-42f0-5f04449bab52_photo
Of course I checked and gave permissions and delegated to user-group
I think the problem is at the beginning of the identifier, the standard ones start with numbers and mine with letters “zcrm”
My suitecrm version is 7.11.15
PhP 7.4
ubuntu 20.04
please, any your advice on how I can fix this, change the code so that the system checks the id with beginning letters
Yes, I’ve read your blog thanks there are many useful things
as I understood from the blog and from my test uploads of images and changes their names in Mysql fields.
for first column it’s not working too
Data in the fields have can be any name if photo ID is of the correct format contactID_photo then the photo will always appear
or it’s wrong?
That doesn’t match. The filenames need to be exactly the Bean id, with photo afterwards.
In your database, you can change the bean ids to be in that format zcrm_3111820000009531260 if you really want to. They don’t have to have that UUID form like 102bcdff-de19-685f-42f0-5f04449bab52.
BUT if you do that, you need to make sure you update all relationship tables where those records are involved. This will be simple if you have just created these new records, and could be very complicated if the records have been in your database for a while, with users working on them doing different things.
It is probably easier to change the filenames to use the bean ID’s.
But right now I do this
I have contact who has id zcrm_3111820000009531260 and I move in /upload folder my image named zcrm_3111820000009531260_photo (no extension) and this contact not displayed photo in detail view
Also I tested that - create new contact who has default suitecrm ID like “32e32e-dsfd23232-32312-323”
and move image in /upload named "32e32e-dsfd23232-32312-323_photo"
so this contact available to display photo in detail view
All my photo files have already changed names and all my contacts ID have changed too and have the same ID
Please see the screen from Mysql. It’s table contacts
Very strange indeed, if it doesn’t have the column name there. Do you have any previous errors (even if they are smaller, non fatal) a few lines above that, that might indicate where the code went wrong?
This is soooo strange. It should be SELECT id FROM..., instead it seems to be using the value in place of the column name. Are you sure you didn’t mess up your vardefs somewhere, or when trying to change things from Studio?
@pgr
no, I’m not changed anything in my vardefs…
But how it works well if I try to test photo with contact who has default ID like "52a52ce9-04fe-9b28-2307-5f1997426e24"
In my opinion, if it works wrong then it wrong to all contacts all photo in contact
I don’t know
upd:
I created new fields for image named avatar and tested.
Sat Jul 25 06:57:51 2020 [72250][1][FATAL] Mysqli_query failed.
Sat Jul 25 06:57:51 2020 [72250][1][FATAL] Query Failed: SELECT 3111820000009782007_avatar_c FROM contacts LEFT JOIN contacts_cstm cstm ON cstm.id_c = contacts.id WHERE contacts.id= 'zcrm': MySQL error 1054: Unknown column '3111820000009782007_avatar_c' in 'field list'
So I can’t added photo via suitecrm interface and I can’t directly added photo via MySql
@pgr
sorry I made a mistake in step 1 . Create new contact that is correct
In contact I already have default photo field.
Please can you create new contact and change his ID to zcrm_3111820000009782007
And try to upload photo via suitecrm. I think that enough to see the result
p/s I no need place zcrm_3111820000009782007_photo_c because it’s not custom fields in my case