Thank you for your response...
This made me wonder, cause it is a valid point you have. But it is nearly as I said above. In line 118 (of class-searchengine.php) the "search_structure" is filled with the entries of "$_zp_exifvars".
[code]
$this->search_structure[strtolower($field)] = $row[2];
Other than stated above there is no fault here. This is done the same way as for the other fields above (lines 92 - 113). The "search_structure" array consits of the key (in your quote 'IPTCCity' and as values the entries of 'gettext('City')'
To debug this I made a var_dump of the array generated by getSearchFieldList() (line 223 of class-searchengine.php) and noticed that the values are now mixed up.
key --> value
value --> key
<code>
array(89) { ["Title"]=> string(5) "title" ["Description"]=> string(4) "desc" ["Tags"]=> string(4) "tags" ["File/Folder name"]=> string(8) "filename" ["Date"]=> string(4) "date" ["Custom data"]=> string(11) "custom_data" ["Location/Place"]=> string(8) "location" ["City"]=> string(8) "iptccity" ["State"]=> string(5) "state".......
[/code]
The original defined keys are unique (e.g. city, iptccity) but as 'gettext('City')' is always the same (not depending on locale), the old key 'city' gets overwritten when it is filled a second time.
During debugging I made a small code example from where this should be seen.
[code]
<?php
// definition as in class-searchengine.php
$search_structure['city'] = 'City';
$search_structure['state'] = 'State';
// definition as in functions.php
$_zp_exifvars = array (
'iptccity' => array('City'),
'iptcstate' => array('State'),
);
// like line 116 ff of class-searchengine.php
foreach ($_zp_exifvars as $field => $row) {
$search_structure[$field] = $row[0];
}
// like function getSearchFieldList()
$fieldlist = array();
foreach ($search_structure as $key => $display) {
if ($display) {
$fieldlist[$display] = $key;
}
}
echo "like function getSearchFieldList()\n";
var_dump($fieldlist);
// like function getSearchFieldList() with $display and $key exchanged
$fieldlist_exchanged = array();
foreach ($search_structure as $display => $key) {
if ($display) {
$fieldlist_exchanged[$display] = $key;
}
}
echo "\n";
echo 'like function getSearchFieldList() with $display and $key exchanged';
echo "\n";
var_dump($fieldlist_exchanged);
?>
[/code]
[Link](https://onlinephp.io/c/98675b84-1cb0-4ff4-b0e6-2f129aed4e6b)
So, the original 'city' field gets lost when 'getSearchFieldList()' is executed.
Unfortunately it can't be fixed as easy as in the example above as switching $display and $key messes up things up a bit in the admin backend. So additional steps would be required to integrate this.
Is this part of the code relevant for ZP 2?
So, the quickest and easiest fix would still be to alter the gettext('City') as stated above.