Hello, I've been writing a script that relies on searching for custom property groups using the PHP SDK. I realized that this is impossible due to a missing urlencode() in openKM/src/openkm/impl/SearchImpl.php. The the property encoding in makeUri() should be changed like this:
What is also unclear is the fact that when you get a saved query using the API, it is impossible to use this query because the properties are in a completely different format. Instead of being in a simple array they are contained in an "Entry" object that is completely incompatible with the makeUri() function of SearchImpl.php
I hope I am not misunderstanding anything but passing the properties to the QueryParams object as a simple array and adding urlencode($key) solved my problems.
Code: Select all
Without the urlencode function around $key, it is impossible to search for properties such as okp:consulting.name, as the colon is not encoded.@@ -922,7 +922,7 @@
}
}
foreach ($queryParams->getProperties() as $key => $value) {
- $uri .= '&property=' . $key . '=' . urlencode($value);
+ $uri .= '&property=' . urlencode($key) . '=' . urlencode($value);
}
if ($queryParams->getAuthor() != '') {
$uri .= '&author=' . urlencode($queryParams->getAuthor());
What is also unclear is the fact that when you get a saved query using the API, it is impossible to use this query because the properties are in a completely different format. Instead of being in a simple array they are contained in an "Entry" object that is completely incompatible with the makeUri() function of SearchImpl.php
I hope I am not misunderstanding anything but passing the properties to the QueryParams object as a simple array and adding urlencode($key) solved my problems.