mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #15184
[Bug 1024271] Re: return value not strictly integer for ArtefactTypeFolder::get_folder_id
The 'return $record->id;' is still not being cast as an integer.
There is in htdocs/artefact/file/lib.php on line approx 700 ad db call that uses the id.
Would that matter if it was a string vs. an integer?
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1024271
Title:
return value not strictly integer for
ArtefactTypeFolder::get_folder_id
Status in Mahara ePortfolio:
Triaged
Bug description:
Extending Mahara and recursively calling
ArtefactTypeFolder::get_folder_id to create user folders, we've
noticed that the return value is not always strictly integer as
claimed.
When a record (folder) already exists, the returned id from the database is of type string.
Thus, recursively calling ArtefactTypeFolder::get_folder_id with the returned id *WILL* fail.
The error is in the last line, which reads "return $record->id;"
Using a mysql database (and possibly others), the return value IS numeric, but returned as a string.
The last line, imho, should therefore read "return (int)$record->id;"
Mahara version: 1.5.1
OS: Linux
Database: mysql
browser: not relevant (core code problem)
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1024271/+subscriptions
References