Greetings,

I'm not sure why this is happening but I just installed Glossify, adjusted the settings and noticed that, in all nodes, the body content disappeared. The titles of the nodes are visible. When I disabled Glossify the body content in all nodes appeared again.

If anyone can lend any insight into this I would appreciate it.

Thanks,

Scott

Comments

rsvelko’s picture

I checked the logs of drupal and there glossify complained about preg_replace and preg_match php errors.

After some research found out that glossify terms (used as part of the pattern in several places there) are not run through preg_quote so that solves the problem I am pretty sure...

Will test it tommorrow and write back.

rsvelko’s picture

Yes - the tests showed that all is fine after the quoting.

Once again - the problem was that some of the term nodes had weird titles (with "/" or $ , # ...) that caused preg_match function to think that the pattern ends prematurely... and as a consequence the $node->body was left empty ...

I give the diff now:

76c76
<             $pattern = '/\b(?<!\"|\/)' . preg_quote($term , "/") . '\b/';
---
>             $pattern = '/\b(?<!\"|\/)' . $term . '\b/';
99c99
<           if (preg_match('/' . preg_quote($term , "/") . '/', $node->body)) { // got one
---
>           if (preg_match('/' . $term . '/', $node->body)) { // got one
eafarris’s picture

Status: Active » Fixed

A no-brainer. Committed to glossify-6.x-1.x-dev. Will be part of the next official release. Thanks very much.

scott859’s picture

Greetings rsvelko and eafarris,

Thanks so much for your insight and help into this!

Very much appreciated.

Scott

Status: Fixed » Closed (fixed)

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

mcurry’s picture

subscribe
This is a problem in 5.x as well.

eeyorr’s picture

Version: 6.x-1.1 » 5.x-1.1
Component: Miscellaneous » Code
Status: Closed (fixed) » Active

This is also a problem with 5.x.

Ivo.Radulovski’s picture

Status: Active » Closed (won't fix)

we need a co-maintainer for version 5.x - we don't support it anymore