-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilesModel::findByPid() funktioniert nicht mit UUIDs #925
Comments
|
Would make sense, but what exactly is your use case though? Are you storing folder UUIDs as strings somewhere? |
|
Not storing, but I select a folder with and get the UUID from the folder. Later I will get all files from this folder. Maybe I can use |
|
Post the complete DCA definition of your field. |
|
I use the extension contao-rocksolid-custom-elements with this DCA: And in the config file of this custom element I get the UUID of the folder with |
Ah, that's the problem then. Usually if you use the Nevertheless, as I said it would make sense to introduce a conversion like in |
|
A method |
|
Yes, that's what I meant. |
Ah ok. Good to know ;-) @leofeyer yes, that's right. |
|
Hm, I just wanted to implement the method, however, it does not really make sense, does it? |
Convert string UUIDs that get passed into the method to binary UUIDs? |
|
Like this? public static function findByPid($intPid, array $arrOptions=array())
{
$t = static::$strTable;
// Convert UUIDs to binary
if (\Validator::isStringUuid($intPid))
{
$intPid = \StringUtil::uuidToBin($intPid);
}
return static::findBy(array("$t.uuid=UNHEX(?)"), bin2hex($intPid), $arrOptions);
} |
|
Yes 👍 |
|
Implemented in 9f5adad. |
Hallo,
die Funktion
\FilesModel::findByPid()scheint noch nicht für UUIDs vorbereitet zu sein.Funktionen wie
\FilesModel::findById()bzw. deren Weiterleitung an die Funktion\FilesModel::findByUuid()haben eine spezielle Abfrage für UUIDs und eine passende Format Umwandlung mit Hilfe von\StringUtil::uuidToBin($strUuid).Bei der Funktion
\FilesModel::findByPid()werden die UUIDs jedoch nicht in ein Binary Format umgewandelt, sondern direkt an den SQL Select Befehl weitergegeben. Dadurch funktioniert dieser dann nicht richtig und liefert keine Ergebnis.The text was updated successfully, but these errors were encountered: