I get the following error message when running Coder Upgrade on a D7 installation which was upgraded from D6:

Undefined index: name in coder_upgrade_module_list() (line 578 of ...\sites\all\modules\coder\coder_upgrade\includes\conversion.inc).

I suppose this is caused by some leftover modules from the old D6 installation which are removed from the modules folder but are still listed in the "system" table. "conversion.inc" (line 564) queries the database to create the list of installed modules:

// Faster to query DB than to rescan files using _system_get_module_data().

I will try to delete the stale entries in the "system" table using phpMyAdmin.

CommentFileSizeAuthor
#9 bad.patch321 byteswebchick

Comments

Blauer Schatten’s picture

I have exactly the same problem. But cleaning my system table didn't help at all.
Have you done anything more than deleting the entries out of this table which are related to D6-modules ?

frank ralf’s picture

I don't think so. Have you tried also cleaning the cache tables?

solotandem’s picture

Have you tried the dev release?

You marked this as a bug, but indicate you are running on a site converted from D6 to D7, which is a bit of an imprecise environment. This module is intended to run in a clean D7 install. If an error occurs because of your environment, then that is not a bug (at best, it would be a feature request).

frank ralf’s picture

Status: Active » Postponed (maintainer needs more info)

@solotandem

This module is intended to run in a clean D7 install.

IMHO an upgraded site from D6 is an obvious use case for Coder Upgrade. However, as the module runs fine indeed on a clean install of D7 I'm marking this as postponed.

solotandem’s picture

@Frank, from the description of the problem and the context in which it is said to occur, this seems to be a bug created during the site upgrade from D6 to D7. The conversion process seems to be faulty leaving behind bad data. If that is the case, then the solution should be with the upgrade path, not this module to have to anticipate what all might be wrong. To take your suggestion to its extreme, this module (or any other module) should handle whatever goofy thing any other module might do to the site. That is, obviously, absurd.

IMHO your phrasing "an upgraded site from D6 is an obvious use case for Coder Upgrade" makes no sense. The module is intended to run in D7. A clean D7. That is the prerequisite, an unstated but implied dependency.

solotandem’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
danchadwick’s picture

Version: 7.x-1.0 » 7.x-2.x-dev
Status: Closed (works as designed) » Active

Reopening this issue as the problem is present on a fresh install of D7 using coder 7.x-2.x-dev. I have resolved the similar problem on the module list page by applying patch 1828330-4 (setting hidden = TRUE in bad.info). This problem is present on the Upgrade tab. It is unrelated to the D6 to D7 conversion.

Debugging it, the cause is a row returned by the query from coder/code_sniffer/Test/bad.module, where the info does not contain a serialized $info['name'] array element.

If you're going to query the system table directly, I suggest something like:

  foreach ($results as $module) {
    $info = unserialize($module->info);

    if (isset($info['hidden]) && $info['hidden]) {
        continue;
    }

    $row = array();
    $row['name'] = $info['name'];
    $row['path'] = dirname($module->filename); // $module->filename;
    $row['dir'] = $module->directory; // dirname($module->filename);
//    $row['filename'] = $module->filename; // Add this for later calls to module_list().
//    $row['status'] = $module->status;
    // TODO Pull files from this table???
    // Would need to change the conversion code to not read the filesystem.

    $rows[$module->name] = $row;
  }

This assumes the hidden = TRUE patch is committed, obviously.

mykmallett’s picture

Also getting this, and many other unexplainable errors on a clean install.

webchick’s picture

Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new321 bytes

Here's a patch to add hidden = TRUE to bad.info. This stops the errors for me.

I would call this at least "major" because it appears to break your Drupal installation despite the fact that you have only downloaded Coder and put it under your sites/all/modules directory somewhere.

webchick’s picture

Component: Coder Upgrade » Coder Sniffer

Also, this is coming from Code Sniffer, not Coder Upgrade.

webchick’s picture

Component: Coder Sniffer » Coder Upgrade
Priority: Major » Normal
Status: Needs review » Active

Uh. Sorry for the noise. Reading the rest of the issue, I'm getting a completely different problem. :D

aendra’s picture

Confirming #7. Moving coder_sniffer out of my Modules directory causes the error to disappear.

ergophobe’s picture

In coder_sniffer/Test/bad.info

; name, description, core is missing here.

That's the problem - the lack of a defined name is causing the error.

Simple fix, but what *is* the name? "Coder Sniffer Test - Bad" ????

Any value fixes the problem, I just don't know the right value.

Homotechsual’s picture

It's supposed to be missing a name... It's an example of a BAD info file.

klausi’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Coder 7.x is frozen now and will not receive updates. Coder 8.x-2.x can be used to check code for any Drupal version, Coder 8.x-2.x also supports the phpcbf command to automatically fix conding standard errors. Please check if this issue is still relevant and reopen against that version if necessary.