First, what a great module. Wish I had known about this 6 months ago when I was doing this by hand! Thanks for all your efforts, it's nice to know that some people still think about Drupal 5.

I just installed this on a D5 site with lots of views and panels, some panel views, and some mini-panels and exported everything. The export seemed to go fine.

Then after I did safe delete, I found that several of the items weren't deleting e.g.:

The following panels_views configurations are not listed and are unsafe to delete because no corresponding file is found, or the configuration and corresponding file differ: ActResBLOCKtally_latest, list_tally_short_DIA, ActResTallyW_bottomleft, ActResTallyW_bottomright, ActResTallyCityW, ActResTallyResultsW

Well, the files are there, and they've just been exported, so there shouldn't be any difference. I quickly realized that all the items showing this error had CAPS in their names, and when I looked at the exported files, they're all in lowercase, due I think to line 468 in c2c.module:

function c2c_name_to_file_name($name) {
  return strtolower($name). '.inc';
}

In Safe Delete, when the files on disk are being compared with the config items in the DB, the comparison is failing on a case mismatch, when it should succeed:

      if (array_search($name, $files) === FALSE) {
        // No file exists
        $configuration['different'][$name] = $name;
      }

I can try to fix this, but I want maintainers' input first: is it better to save the files to disk with mixed-case names (which will then match correctly), or keep the filenames lowercased, and take that into account when comparing?

CommentFileSizeAuthor
#2 685290.patch680 byteslaken

Comments

laken’s picture

Title: Apparently doesn't handle CAPS in item names » Doesn't handle mixed-case item names correctly
laken’s picture

StatusFileSize
new680 bytes

Here's a trivial patch that keeps the filenames lowercased – still would like input on which way to go though…

Bevan’s picture

Looks good to me. I think this is safe since, IIRC, views' test for unique id/names is not case sensitive.