Hi,
when accessing my page, I receive the following error message:

Notice: Undefined property: stdClass::$character_set in AtjsPregCallback->execute() (line 738 of /var/www/drupal/sites/all/modules/atjs/atjs.module).

A potential solution looks like the following:

diff --git a/sites/all/modules/atjs/atjs.module b/sites/all/modules/atjs/atjs.module
index 7b62278..febe30c 100644
--- a/sites/all/modules/atjs/atjs.module
+++ b/sites/all/modules/atjs/atjs.module
@@ -735,6 +735,9 @@
   }
 
   public function execute($text) {
+  	if(!isset($this->listener->character_set)) {
+  		$this->listener->character_set = 'basic';
+  	}
     switch ($this->listener->character_set) {
       case 'extended':
         $character_set = '^\s';

I set the value to 'basic' because this falls through to the default case of the switch statement.

I am unsure, why the character_set is not set.

What do you think? Do you need additional information from my side?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ehj-52n created an issue. See original summary.

ehj-52n’s picture

david.hughes’s picture

That's weird, I thought the listeners should by default have character_set set to 'basic'. I think your listener probably existed before the character set option was a thing, and so maybe we missed a trick and should have included an update hook to set any unset character_sets to basic.

Either way, that patch should fix the issue. Can you please change the indentation from tabs to spaces and add a space between the if and opening bracket? Will give this patch a try later today.

ehj-52n’s picture

Hi David,
I updated the patch as requested.
Sorry for the delay and kind regards,
Eike

  • david.hughes committed 461beea on 7.x-1.x authored by ehj-52n
    Issue #2849176 by ehj-52n: Error message on several pages: "Notice:...
david.hughes’s picture

Status: Active » Fixed

Fixed, thanks Eike!

Status: Fixed » Closed (fixed)

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