I went to enable the following Authcache modules at the same time:

Authcache
Authcache Varnish
Authcache Personalization API
Authcache Debug
Authcache Menu
Authcache Search

After hitting save, the page appeared broken with this error:

AuthcacheP13nObjectFactoryException: Failed to create instance in AuthcacheP13nObjectFactory->get() (line 142 of /sandbox/d7/all/modules/contrib/authcache/modules/authcache_p13n/includes/AuthcacheP13nObjectFactory.inc).

I flushed the cache and things seemed fine so I continued on and configured Authcache. It seemed to be working correctly. I then went back to enable Authcache Form, and got the same error when saving the modules page. Thanks in advance.

CommentFileSizeAuthor
#6 2096967-new-instance.diff862 bytesznerol
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

znerol’s picture

Thanks for the report. Is there anything special about your installation? I quickly tried to reproduce this with a fresh drupal but it I runs smooth over here.

Would it be possible for you to enable xdebug on your site in order to gather a stack-trace? That might help me to track down the failure mode.

vinmassaro’s picture

Hmm, I've been testing Authcache so far on my laptop under MAMP without this problem. I was attempting to configure this on our university development environment and ran into this error. When I restore a Drush archive of the site in this state to my laptop, I can't reproduce the error when enabling/disabling modules. Is it possible there is a system level requirement we're missing in order for code to run correctly for AuthcacheP13n?

znerol’s picture

Not that I know. The test suite runs without problems on the drupal.org QA infrastructure. I think they are using PHP 5.3. I'm using 5.4 on my laptop.

vinmassaro’s picture

The environment I get the error on is running PHP 5.3.3 with APC.

I just disabled all Authcache modules and uninstalled them. I then enabled them one at a time in this order.

Authcache
Authcache Varnish
Authcache Personalization API

No errors up to this point. I then enabled Authcache Debug and got the same error again.

znerol’s picture

Ugh, 5.3.3 is pretty old. I try to speculate what happens: On line 139 in modules/authcache_p13n/includes/AuthcacheP13nObjectFactory.inc we try to instantiate AuthcacheDebugInfoSetting using ReflectionClass::newInstanceArgs(). However that does not work due to PHP bug #52854 because AuthcacheDebugInfoSetting does not have a constructor. If this hypothesis is correct, then it would help when you add an empty constructor to AuthcacheDebugInfoSetting:

public function __construct() {
}

Does the error go away when you add an empty constructor to AuthcacheDebugInfoSetting?

znerol’s picture

Status: Active » Needs review
FileSize
862 bytes

Possibly we could work around this problem in the factory class (see patch). I did not test this (other than the syntax), let's see whether the test bot likes it.

vinmassaro’s picture

Yes, Redhat Enterprise Linux runs 5.3.3 :(

I've added your suggestion in #5 and waiting for a build to deploy now.

vinmassaro’s picture

I added your suggestion in in #5 so AuthcacheDebugInfoSetting looks like this. Is this right?

class AuthcacheDebugInfoSetting implements AuthcacheP13nSettingInterface, AuthcacheP13nSettingValidatorInterface, AuthcacheP13nSettingAccessInterface {

  public function __construct() {
  }

  /**
   * Ensure that the parameters consist of exactly one string.
   */
  public function validate($params) {
...

I still get the error when enabling Authcache Debug. Going to try your patch in #6.

vinmassaro’s picture

I applied the patch in #6 and I can enable Authcache Debug without getting the error now.

znerol’s picture

Ok, thanks for the testing. I'll include the patch in an upcoming release.

znerol’s picture

Status: Needs review » Fixed

Committed: 69375f6

Status: Fixed » Closed (fixed)

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