Ticket #2603 (closed defect: wontfix)

Opened 3 months ago

Last modified 3 weeks ago

line 104 of /sapphire/filesystem/folder.php - check if the name is valid....

Reported by: nicolaas Assigned to: ischommer
Type: defect Priority: minor
Milestone: 2.2.3* Component: CMS - Files and Images section
Version: 2.2.2 Severity: medium effort / impact
Keywords: /sapphire, filesystem, folder.php Cc:
Due date: Hours:

Description

I got an error on a site that related back to the following lines:

foreach($dbChildren as $dbChild) {

$className = $dbChildClassName?; $hasDbChild[$dbChildName?] = new $className($dbChild);

}

I changed this to:

foreach($dbChildren as $dbChild) {

$className = $dbChildClassName?; if($className) {

$hasDbChild[$dbChildName?] = new $className($dbChild);

}

} This meant that my client was still able to see the assets in the CMS (and not just get a PHP error). Obviously there is some error somewhere in the DB, but adding that line takes care of this more gracefully.

Attachments

Change History

Changed 3 weeks ago by ischommer

  • status changed from new to closed
  • resolution set to wontfix

So somehow SilverStripe? managed to get an empty classname into the database row? I don't think its appropriate to brush over this data integrity error by silently failing if the classname is empty, like suggested. We should rather find the root cause. So if you can track down the error, please create a new ticket - optimally with a database dump of the File/Folder tables and a description which user actions were taken right before the error occurred.

Note: See TracTickets for help on using tickets.