Community

Maddening Glossary module error: warning: strpos() [function.strpos]: Empty delimiter.

I keep gettign this error:

warning: strpos() [function.strpos]: Empty delimiter. in /home/tork/public_html/modules/glossary/glossary/glossary.module on line 445.

I have replaced the module with the latest version. I have deleted and added back glossary terms. But the error keeps coming back.

Any ideas???

You can get the error for your self if you browse this book: http://torkzadeh.com/node/509

Comments

Check your glossary url

The function strpos is not returning anything. Perhaps something to do with that double 'glossary' directory you have in the url above? Move glosssary.module and all the other files in the second 'glossary' directory/folder to the first 'glossary' directory/folder and see what happens.

Didn't help

Thanks for your reply.

I moved the files to the higher glossary directory and deleted the lower one. Didn't help. Any other ideas?

I've already replaced the files with the latest versions.

Let's ask help from the experts

Me no codehead so let's holler for help. Open your glossary.module file and report back the line referred to in the error message. Also, did you run update.php to update your versions?

PHP coders, pls help. The following are lines in the glossary.module file referring to strpos:

$findfunc = (variable_get("glossary_case_$format", "1") ? 'strpos' : 'stripos');
  $next = $findfunc($text, $match);

function _glossary_is_boundary($char) {
  return (strpos("!\"#\$%&'()*+,-./:;<=>?@[\]^_`{|}~ \t\n\r", $char) !== FALSE);
}

// Natively only available in PHP 5+
// WARNING: Eats a tremendous amount of memory!
if (!function_exists("stripos")) {
  function stripos($haystack, $needle, $offset = 0) {
    return strpos(strtoupper($haystack), strtoupper($needle), $offset);
  }
}

I wasn't aware that I need

I wasn't aware that I need to run update.php. This installation of 4.6 was not an upgrade from an older version. Do I still need to run update.php when I add modules? I did anyway and it just updated one item having to do with formatting of data in database.

Anyway, line 445 in my glossary.module is:

  return strpos(strtoupper($haystack), strtoupper($needle), $offset);

Here are a few lines:

// Natively only available in PHP 5+
// WARNING: Eats a tremendous amount of memory!
if (!function_exists("stripos")) {
  function stripos($haystack, $needle, $offset = 0) {
    return strpos(strtoupper($haystack), strtoupper($needle), $offset);
  }
}

function glossary_trip_search_taxonomy($term) {
  return l($term->name, "glossary", NULL, NULL, $term->tid). trip_search_teaser($term->description);
}

I would appreciate any help. I find it strange that this would have to do with the code since there are no issues posted like mine. So that makes me think that it has to do with something specific to my installation or data and not the code. But I'm a novice anyway.

Problem solved

Here's what was causing the error: one of the terms I had created had a description but no term name. Once I added a term name to that term, the error was gone.

Same error but no blanck term...

Hi,

I've the same issue from (warning: strpos() [function.strpos]: Empty delimiter in....), but I don't think some term's name are missing: do you have other tips (and how can be shure I didn't omit any term's name?)

BR

nobody click here