I got the above bug after updating Protected Node on my Drupal installation (which is actually built on Commerce Kickstart 7.x-2.15). Any ideas?

Removing the module from /sites/all/modules (or similar) solves the problem, but also removes Protected Node's features.

CommentFileSizeAuthor
#29 fatal_error_class-2306373-29.patch6.52 KBvinmassaro
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

izus’s picture

Status: Active » Postponed (maintainer needs more info)

weird,
i have also the most updated code but can't reproduce the issue.
did you try to just clear cache ?

carsonw’s picture

I downloaded protected_node and installed it on an existing site and ran into this same issue. There were only two ways I could get the site to go back online: (1) disable the module manually by editing the system table or (2) delete the tests folder altogether.

Drush kept outputting the error if I tried to disable the module or clear caches.

izus’s picture

I just tested with an existing drupal7, the last 7 dev version of protected_module and can't notice any Fatal error.

i also tested with simplytest.me the 7 branch and couldn't find any issue.

Grimreaper’s picture

Hello,

I didn't take the time to test. But I read that for the tests, there is also a contrib module https://www.drupal.org/project/simpletest.

When reading the documentation of simpletest, they mentioned that there is a configuration to make to use the contrib module instead of the core one.

@tgeller, you mentioned that it is a commerce kickstart. Maybe this distribution uses the contrib module and it is the source of the problem ?

EDIT : link to the documentation : https://www.drupal.org/simpletest-tutorial-drupal7

EDIT 2 : @tgeller, not @carsonw, sorry

carsonw’s picture

It's Tom Geller (tgeller) who's using Commerce Kickstart. The site I'm using it on is not using a contrib installation profile.

izus’s picture

@Grimreaper i don't think this is accurate, Core does the stuff well for testing starting from D7, D6 was contrib only + a patch to core
in addintion, simplytest.me that i tested with doesn't have the issue.
i still search for a way to reproduce the issue, i f anyone has a path for this, please drop some lines here

Grimreaper’s picture

I cannot reproduce the problem.

I test on a fresh install of a drupal 7 and the latest protected node 7.x-1.x version. I have no problem.

Did the problem occur right after enabling protected node ?

I give ideas that come to my mind :
- php version
- web server : apache, nginx, microsoft ?
- web server config ?
- web server's module activated ?

Anybody’s picture

Same problem here. If you enable protected_node_rules (rules !) the problem occurs.
The problem is, that the tests are loaded in the .info file but the required framework files are not loaded.
Simpletests are OFF for me.

Is it anyway correct that the .test files are loaded, even if they are not required in production? That's also bad for performance.

Removing the files in the .info file works as quickfix.

izus’s picture

enabled protected_node_rules with no notice
can this be related to php version ? i use php 5.4.30

Anybody’s picture

We use php 5.3 - well it can. Perhaps some kind of auto-loading? Or have you enabled simpletest or something like that in your modules?

izus’s picture

no, i don't have simpletest enabled.
actually i tested by reinstalling a new drupal with only protected_node enabled and then i enabled protected_node_rules
i created some protected articles and didn't notice any fatal error :/

Grimreaper’s picture

Hello,

Is the problem still present or can we change the status to closed (cannot reproduce) ?

Anybody’s picture

I don't think that it's fixed, it doesn't seem to be such a simple problem, perhaps it depends on a module combination or the PHP version. Somehow the test classes are loaded without their requirements... I'll try to have a deeper look again and retry.

Anybody’s picture

PS: I also can't reproduce it in a clean environment on http://simplytest.me/ but the problem exists in a customer installation.

Pene’s picture

I've just ran into this error. PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34); Protected Node 7.x-1.x-dev when i'm upgrading from 7.26->7.31 as well.

dandaman’s picture

These lines are included in the protected_node.info file and I'm not sure if they should be there:

files[] = tests/protected_node.test
files[] = tests/protected_node.per_node.test
files[] = tests/protected_node.per_type.test
files[] = tests/protected_node.global.test
files[] = tests/protected_node.mail.test
files[] = tests/protected_node.private_file.test
files[] = tests/protected_node.view_mode.test

Once I removed them from the .info file then I stopped getting these errors when clearing the site's cache.

izus’s picture

i guess we need those in .info for tests classes to be loaded dynamically.
this is the recommendation for files that contain classes in D7
From https://www.drupal.org/node/542202#files

all modules must now declare any code files containing class or interface declarations in the .info file

sportel’s picture

The problem still exists. I just installed the latest 7.x-1.x-dev, and got the error.

izus’s picture

as per #9 and #10 this may be an issue of php version.
which php version do you use ?

sportel’s picture

PHP version is 5.3.17.
The error disappeared when I (after deleting the protected_node module folder first and later putting it back) enabled the simpletest module.

I'm no developer at all, so maybe I'm saying something stupid here, but aren't the code lines mentioned in #16 only necessary for testing purposes? Could that be the reason that the errors have disappeared after enabling the simpletest module?

dandaman’s picture

Ohh, just had a realization. I was getting this error when running Drush commands on Drush 6.2.0. Maybe these errors don't show up if you're using a web browser.

But in my experience it seemed that if the files[] are set in the .info Drush 6.2.0 tries to load them and since they don't have SimpleTest enabled the PHP errors are thrown.

Grimreaper’s picture

Hello,

Can someone write the exact error message he/she obtains please ?

sportel’s picture

See title of this issue.

Grimreaper’s picture

Oups, thanks, I no more noticed it.

It's DrupalWebTestCase, so that's not the order of loading of the protected node test files.

rakun’s picture

After upgrade to latest dev version I got same error.

Server version: Apache/2.2.22 (Debian)

MySQL
Server version: 5.5.40-0+wheezy

PHP 5.4.34-0+deb7u1

Debian 7

vinmassaro’s picture

Status: Postponed (maintainer needs more info) » Needs work

We are running into this after enabling protected_node:

Error: Class 'DrupalWebTestCase' not found in /d7/sites/all/modules/contrib/protected_node/tests/protected_node.test,

Drupal 7.33
PHP 5.3.3

vinmassaro’s picture

I toggled between different versions of Protected Node and the problem disappears when I revert to a version of the module before tests were added. Simpletest module is disabled. If you delete the tests directory, enable simpletest module, then restore the tests directory, the error goes away.

izus’s picture

Hi,
as i alreaddy mentionned, i am bothered with this issue as i can't reproduce it locally even with a new drupal 7 installation.
may be we are missiing something special but the sutructure of the tests is near to the Views module one http://cgit.drupalcode.org/views/tree/views.info and no one seems to complain about Views
so please guys if you can reproduce the bug and have a nice patch for it, i'll be happy to help.

another test that can be done is maybe the module weight, there is protected_node_install that sets the weight to 80, can you please try to play with that weight and say if it is somehow guilty !

Thanks

vinmassaro’s picture

Ok, I worked through this with @izus this morning and we found that it was being caused by the Mailsystem module trying to load protected_node.mail.test inside mailsystem_get_classes();. It appears this is fixed in Mailsystem 7.x-3.x by excluding test files, but the latest stable release as of today is 7.x-2.34 which does not contain this fix.

Attached is a patch that renames protected_node.mail.test to protected_node.mail_test.test to avoid being picked up by mailsystem_get_classes(); at all. Thanks!

izus’s picture

Status: Needs work » Needs review

trigger automated tests

  • izus committed 6400df8 on 7.x-1.x authored by vinmassaro
    Issue #2306373 by vinmassaro, izus, Grimreaper, Anybody, sportel,...
izus’s picture

Status: Needs review » Fixed

This is now merged ! (#29)
Thanks all :)

Status: Fixed » Closed (fixed)

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