← Back to team overview

mahara-contributors team mailing list archive

[Bug 1024271] [NEW] return value not strictly integer for ArtefactTypeFolder::get_folder_id

 

Public bug reported:

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)

** Affects: mahara
     Importance: Undecided
         Status: New

-- 
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:
  New

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


Follow ups

References