mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #09642
[Bug 1024271] Re: return value not strictly integer for ArtefactTypeFolder::get_folder_id
Hi Rogier,
This is a bug, but I'm wondering how you came to find it. Currently in
the core code, there is no call to get_folder_id that uses the result of
that method as an argument. Are you making custom code for Mahara? If
so, until it is fixed I would suggest casting to an int yourself
manually, or supply a patch to get merged with core. You can either
attach this patch here, or (more preferred) use our gerrit review
system. See
https://wiki.mahara.org/index.php/Developer_Area/Contributing_Code
Cheers,
Hugh
** Changed in: mahara
Status: New => Triaged
** Changed in: mahara
Importance: Undecided => Low
** Tags added: bite-sized
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
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