I'm using Coder Upgrade 7.x-dev and Drupal 7 beta3. I can't get the module to write anything to the log or create any patches. I've tried on multiple modules.

Comments

Anonymous’s picture

FYI, the file system is working properly on my installation with other modules such as Upload.

Anonymous’s picture

Ok, so I got this to work by enabling a handful of options and disabling one. I'm not sure which of these was the one that made it work, though I would guess it was disabling the separate process.

Enabled:

  • Update Drupal core modules
  • Replace files
  • Enable debug output from coder upgrade
  • Enable debug output from grammar parser

Disabled:

  • Use separate process
Anonymous’s picture

Category: support » bug

Changing from support to bug fix, as I no longer need support and this seems like it is probably a bug.

solotandem’s picture

Category: bug » support

This may be a bug with this module. However, so far, you have indicated a symptom (files are not written) but you have not indicated a cause of something at fault with the module. Can you provide some specific information? Is an error message displayed? Do you have write access to the files directory (or wherever the module is trying to write to)? I run Drupal 7-dev and the latest dev or published releases of Coder Upgrade and all works as intended.

Anonymous’s picture

Yes, as I indicated, the file system is fine. As I also indicated, once I changed a configuration in the settings form, it did work. I think this makes it pretty clear that I have access to the files directory.

No error message was displayed except for the message that the system couldn't get the patch file because there was no patch file. There were no errors logged.

solotandem’s picture

Actually, the changes you made to the configuration settings may indicate just the opposite. By enabling "Replace files" you are writing the new module code over the existing module code. You may still not have access to the Coder Upgrade output directory (by default at sites/yoursite/files/coder_upgrade) where the patch file would be written. Have you looked at the root files directory for a log.txt or debug.txt file? If you visit "admin/reports/status" does Coder Upgrade directory say it is writable?

If your module code has any size to it, enabling debug output will produce a sizable debug.txt file.

You could always add some debug output of your own using the cdp() function (if debug setting is not checked, then also set global $debug = TRUE). If it doesn't show up, I would check file system permissions. Are you able to run PHP from command line (CLI mode) which would be needed for the "Use separate process" setting?

Anonymous’s picture

Here's what I see at admin/reports/status:

Coder Upgrade directory Writeable (sites/default/files/coder_upgrade/new)

solotandem’s picture

Add some debug code, see what goes on, and report back. Or run your module through the live site at http://upgrade.boombatower.com.

Anonymous’s picture

Thanks, I tried the service on your site and it looks like it gave me back the same version that I was able to get by disabling those settings. Unfortunately, changes that have been made in #643008: A completely new database API has been added haven't been applied, so the old database functions are still in there.

solotandem’s picture

The live site also has the SQL parser installed. It is not bullet-proof but may get you started on the new DB API. Give it a try and let us know.

sylvain lecoy’s picture

I confirm its not working with the drupal-rc1 as well and with the 7.x-1.0-beta5 of coder.

solotandem’s picture

Can any of you who "confirm its not working" debug the code and see why? Without an error message or some confirmed cause, it's a bit difficult to fix an unknown bug. I run the latest code for drupal and this module with no problems. So does the live site mentioned in #8 (which has already had 400 some modules run through the code).

solotandem’s picture

Can any of you who "confirm its not working" debug the code and see why? Without an error message or some confirmed cause, it's a bit difficult to fix an unknown bug. I run the latest code for drupal and this module with no problems. So does the live site mentioned in #8 (which has already had 400 some modules run through the code).

solotandem’s picture

Assigned: Unassigned » solotandem

You all are correct. My configuration allows me to run the code. I believe any of the following sets of changes will allow the code to run. If coder and grammar_parser modules are installed in sites/all/modules, then use set 1 or 2. If coder and grammar_parser modules are installed in sites/yoursite/modules (or you will move them to this location), then use set 3 or 4. My apologies for the inconvenience. Until I make a new release of the two modules, please make one of these sets of changes.

Set 1
- make a writeable (by the web server) memory.log file in the root of your drupal installation (where index.php is)
- turn off "use separate process" in the coder upgrade settings

Set 2
- install http://drupal.org/project/issues/grammar_parser_ui
- turn off "use separate process" in the coder upgrade settings

Set 3
- make a writeable (by the web server) memory.log file in the root of your drupal installation (where index.php is)
- leave on "use separate process" in the coder upgrade settings (the default)

Set 4
- install http://drupal.org/project/issues/grammar_parser_ui
- leave on "use separate process" in the coder upgrade settings (the default)

sylvain lecoy’s picture

I got this problem on the coder setting page if it can help :

File sites/all/modules/developer/coder/coder_review/core.coder_review_ignores.txt doesn't exist or isn't readable.

solotandem’s picture

Category: support » bug
Status: Active » Fixed

Fixed in beta6 release. Please download it and the 7.x-1.1 release of the Grammar Parser and let me know if it works as expected.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

vladsavitsky’s picture

Status: Closed (fixed) » Active

I have used
Drupal 7.0
Coder 7.x-1.x-dev
Grammar Parser 7.x-1.1
and have got the same problem as a topic starter.

And only directions from comment #2 (http://drupal.org/node/982380#comment-3756720) helped me to got coder_upgrade working.

solotandem’s picture

Status: Active » Closed (fixed)

The only setting you need to change is "Use separate process." What OS are you running?

vladsavitsky’s picture

Status: Closed (fixed) » Active

Yes, you're right I have disabled "Use separate process".
I'm running Ubuntu (LAMP), PHP 5.3.

solotandem’s picture

Yesterday's dev release includes implementation of #780016: PHP 5.2 compatibility - instanceof operator. This should only affect those running on PHP 5.2.

Would all of you who have posted on this issue try out this release and see if it helps? Please turn off "Run in separate process." (I intend to commit this change also.)

And I reiterate my comments in #4 above. My debugging efforts with PHP 5.2 seemed to indicate the separate process script would fail when it called coder_upgrade_path_print() and tried to evaluate (what used to be) the is_a() call. I don't know if is_a() was the problem, or the class it was checking (PGPList in this case) not being loaded at the time, or something else.

NROTC_Webmaster’s picture

After trying the settings listed in #2 and #14 I'm getting the following error. This is step up from it not giving me anything so I don't know if it will help or if it is a separate issue.

Fatal error: Class 'PGPReader' not found in /public_html/d7/sites/all/modules/coder/coder_upgrade/conversions/begin.inc on line 126

This issue references it https://drupal.org/node/1147390
I do have grammar_parser installed in sites/all/libraries and the coder review works fine.

I have the Jul-09 dev version

Here is the code starting at line 119 in begin.inc

      elseif (in_array(pathinfo($filename, PATHINFO_EXTENSION), $extensions)) {
        $values = array(
          $_coder_upgrade_module_name . '_theme',
          $_coder_upgrade_module_name . '_menu',
        );
        $cur = file_get_contents($dirname . '/' . $filename);
        // Create reader object.
        $reader = PGPReader::getInstance();
        coder_upgrade_memory_print('create reader for file ' . $filename);
        $reader->setSnippet($cur);
solotandem’s picture

Do you have the libraries 2.x module installed? Without it the Grammar Parser files will not be loaded.

anandvivek700’s picture

Priority: Normal » Critical

Grammar Parser should NOT be installed and enabled as a module.
Grammar Parser should be installed as a library using the 2.x release of Libraries API module.
error show

liquidcms’s picture

i couldn't get this to work until i manually created the following folders:

/sites/all/files/coder_upgrade/new
/sites/all/files/coder_upgrade/patch

i must have missed somewhere where it said to do this.

solotandem’s picture

Those directories should be (will be) created automatically if the web server user has permissions to do so in /sites/all/files/. If you use the standard module form, then the writeability to those directories will be checked as an installation requirement. If not met, then a message should be displayed.

marcoka’s picture

i have the same like #24

solotandem’s picture

Category: bug » support
Status: Active » Closed (cannot reproduce)

Reiterate #4. If this fails, then someone should be able to debug the situation and provide some evidence of a bug.