photools.com Community

IMatch Bug Reports and Feature Requests => Bug Reports => Solved Bug Reports (for next version) => Topic started by: JohnZeman on January 08, 2024, 12:42:00 AM

Title: Metadata Mechanic Question
Post by: JohnZeman on January 08, 2024, 12:42:00 AM
During a text replace operation with the Metadata Mechanic can the mechanic replace the word

and

with

&

?  So far when I have tried to replace and with & in a text field the mechanic just removes everything from the word and to the end of the text.
Title: Re: Metadata Mechanic Question
Post by: Mario on January 08, 2024, 09:00:01 AM
My first guess is that & is a special character for HTML and thus IMatch apps and IMatch Anywhere Web Services. it must be handled in a special way when sending requests to IMWS. I'll have a look.
Title: Re: Metadata Mechanic Question
Post by: rienvanham on January 08, 2024, 09:25:44 AM
In many "languages" (e.g. XML) it is "&" for the "&" character.
Title: Re: Metadata Mechanic Question
Post by: Mario on January 08, 2024, 10:06:51 AM
Not in this case.
& is used to separate parameters in an URL like v1/files?id=123&a=b&c=d&filter=\reg

The problem was that the specific combination of parameters John's MD Mechanic options created a query URL like this:
http://127.0.0.1:50519/v1/files?idlist=%40imatch.filewindow.active.selection&fields=id&tagtarget=XMP%3A%3Adc%5Ctitle%5CTitle%5C0&varreplace=and&varreplaceWith=%26&escapevariables=false&auth_token=06adccc245ec66b6ea034655cf77c5cef44cb11c766e62b6957859aaa08a537a
and the duplicated && resulting from the %26& was not handled correctly when IMWS was parsing the parameters.

Fixed for the next release.
As a work-around, use a Metadata Template for now.