WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 06.10.2019 13:21:20

gawi
Member

Menu link

Hi

I use WBCE 1.4. on WAMP with PFP 7.0.10.
When adding page of Menu Link type following warning appears:

Warning: strpos(): Empty needle in D:\WAMP\www\....\modules\menu_link\modify.php on line 107

Menu link is created and everything is working correctly despite the warning that appears during adding link.

Is there something in the code of menu link module that can be corrected?

Regards
Gawi

Offline

#2 06.10.2019 18:27:11

florian
Administrator

Re: Menu link

I can't reprocuce this error. I guess it appears only on local testing environments, not on real live webservers.


Sorgen sind wie Nudeln: man macht sich meist zu viele.

Offline

#3 06.10.2019 18:30:58

gawi
Member

Re: Menu link

It does not appear on real serwer. But on live webserwer warnings are hidden.

Gawi

Offline

#4 06.10.2019 18:53:46

florian
Administrator

Re: Menu link

But on live webserwer warnings are hidden.

Not necessary. I have activated at settings > advanced options > php error reporting to "Show all errors" (and that online testing environement is able to show warnings and errors an does not suppress them), and I still don't get that warning. I also tried at general settings disabling manage sections / section blocks, set the section-anchor string to empty string and decreased PHP to 7.0.32 (the lowest version available), but still no warning appears.

The strange thing about the warning: Line 107 reads

if (strpos($aData['anchor'], SEC_ANCHOR) !== false){

and the needle is the constant SEC_ANCHOR. But why can it be empty ln some cases?

Last edited by florian (06.10.2019 23:46:58)


Sorgen sind wie Nudeln: man macht sich meist zu viele.

Offline

#5 06.10.2019 19:45:36

kant
Member

Re: Menu link

Hm ...
error confirmed - WBCE 1.4.0 - MAMP PHP 7.3.8 (xd 2.7.2) - local ...

The problem is that SEC_ANCHOR holds an empty string ("") ...
and in the "line 107" we/you are trying to find an empty string inside a given source roll  ...

so - a quick one/fix could be
File: ~/modules/menu_link/modify.php
Line: ~107

[== PHP ==]
if ((SEC_ANCHOR!="") && (strpos($aData['anchor'], SEC_ANCHOR) !== false)){

to test also if the SEC_ANCHOR is "empty" ...
kind regards
Kant


Sapere aude!

Offline

Liked by:

stefanek

#6 06.10.2019 20:03:49

gawi
Member

Re: Menu link

Thank you. It works. No warnings! smile

Gawi

Offline

#7 12.10.2019 19:22:19

colinax
Member

Re: Menu link

Now fixed on GitHub.

Offline

Liked by:

stefanek

Board footer

up