Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#4 | atjs-undefined_property_character_set-updated-patch-2849176-7.x-1.0.patch | 471 bytes | ehj-52n |
#2 | atjs-undefined_property_character_set-2849176-7.x-1.0.patch | 467 bytes | ehj-52n |
Comments
Comment #2
ehj-52n CreditAttribution: ehj-52n as a volunteer commentedComment #3
david.hughesThat'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.
Comment #4
ehj-52n CreditAttribution: ehj-52n as a volunteer commentedHi David,
I updated the patch as requested.
Sorry for the delay and kind regards,
Eike
Comment #6
david.hughesFixed, thanks Eike!