Recent Topics

1 Mar 31, 2021 17:56    

I have a problem with posts written in Markdown. Although the content is rendered correctly, the beginning of the post contains multiple entries of this kind:

Notice: Trying to access array offset on value of type null in ~/public_html/plugins/markdown_plugin/_parsedown_extra.inc.php on line 241

I checked the file itself and I see nothing unusual in that area

    protected function blockSetextHeader($Line, array $Block = null)
    {
        $Block = parent::blockSetextHeader($Line, $Block);

        if (preg_match('/[ ]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))   // <-------- line 241
        {
            $attributeString = $matches[1][0];
            $Block['element']['attributes'] = $this->parseAttributeData($attributeString);
            $Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
        }

        return $Block;
    }

My php.ini has this: error_reporting = E_ALL & ~E_NOTICE, so I was expecting notices not to be displayed.

Is there some other place where the setting might be overridden in the code of b2evolution or some of its plugins?

3 Mar 31, 2021 22:22

Thanks for your feedback.

That's strange. On one hand, .htaccess is indeed also setting that flag, but it sets it to the same value:

   php_value error_reporting E_ALL & ~E_NOTICE
   php_flag display_errors Off

Also, when I call phpinfo() I see that the value is 32759 (the E_NOTICE flag is not set in this case). So that's still puzzling.

I made a somewhat unusual observation - the notices are shown when I view the article in the back-office UI, but they are not shown when the post is published and viewed from the public's perspective.

4 Apr 01, 2021 07:31

@gr8dude wrote earlier:

Thanks for your feedback.


Also, when I call phpinfo() I see that the value is 32759 (the E_NOTICE flag is not set in this case). So that's still puzzling.


I made a somewhat unusual observation - the notices are shown when I view the article in the back-office UI, but they are not shown when the post is published and viewed from the public's perspective.

Maybe when you're accessing the back office there's another htaccess

5 Apr 01, 2021 07:50

@gr8dude wrote earlier:

Thanks for your feedback.


Also, when I call phpinfo() I see that the value is 32759


Whereas the value is correct for php5 it is supposed to be 30711 for php7 (which is what I have) as E_STRICT is removed in PHP 7

See https://maximivanov.github.io/php-error-reporting-calculator/

EDIT: There are two values shown via phpinfo and I have
Local Value > 30711 and Master Value > 22517

So 30711 is set by b2evo, but I'm not yet looking for where :)

6 Apr 01, 2021 08:08

Sorry for the multiple posts but I'm working through this bit by bit..

I just want to add that the 30711 was due to me setting [php_flag display_errors On] in the htaccess in the /conf to see if it was all working OK

Now it's 30719 :)

UPDATE:

Ok my root htacces has

# You may want to turn the following to Off on production servers
	# Please do this only if you know what you're doing and will be able to retrieve potential errors from your error log
	php_flag display_errors On
	# The following is the same as 'E_ALL & ~ E_STRICT' (except those constants may not be available here)
	php_value error_reporting 30719

Maybe you have some old htaccess file hanging around?

7 Apr 01, 2021 09:35

Ok I've been looking at the hph error notification so far and don't use the markdown plugin

I've now installed the markdown plugin fo 7.2.3 which from checking seems the same as the one for 7.2.2

Do you get the notice even with a simple text as
##OK

That produces no error for me

8 Apr 01, 2021 11:39

Ok I can now confirm I have a different problem with using the markup plugin, it seems to mess up my layout, like a closing div is missing. I'll update this post with more info.
~
~ After deleting the post the problem changed
~ After disabling the plugin the problem return as it was originally
~ After uninstalling the plugin it is still there
~
I'm going to check the html page source via Firefox to see If I can find what has changed
~
~ I now seem to have a stray closing div tag added before the closing body tag ??

OK This problem wasn't related and was a simple html error?? but didn't show up until I messed with the markup plugin ??

Most likely a cache issue and not related to the plugin at all.

So will reinstall the plugin and create a test post to use it again :)


Form is loading...