+1 vote
in Rock by TinaStephens (8.6k points)
edited

Asana: https://app.asana.com/0/1202285749308575/1204017547142974/f

Sun Valley https://rock.sv.cc/ Login: tstephens
Password: fvf1frq!twg4agm6MZW

Person Attribute 26695 https://rock.sv.cc/admin/general/person-attributes was a file type of Image. People have been loading PDF's. After 13.7 the incorrect file type doesn't show and can't be loaded as PDF.

How do I find and update all of them to the new attribute 28521 ?

before I delete the old attribute?

1 Answer

+1 vote
by DavidTurner (14.9k points)
edited
 
Best answer

We have a SQL script that can copy attribute values from one attribute to another. However, in this case, I'd recommend just updating the field type of existing attribute from 'Image' to 'File'. The one thing to be careful about when updating field types though is the attribute qualifiers. Each field type has unique qualifiers that need to be set. an "Image" field type has the following three qualifiers: binaryFileType, formatAsLink, and img_tag_template. the "File" field type has only one qualifier: binaryFileType.

Here's the SQL I ran to change the field type on your attributes:

update [Attribute]
set FieldTypeId = 32
WHERE [Id] IN (26695, 20261)

delete AttributeQualifier
where attributeid in ( 26695, 20261 )
and [key] in ( 'formatAsLink', 'img_tag_template' )
Welcome! Here you can ask questions and receive answers (hopefully) from other members of our team.
...