[phpBB Debug] PHP Warning: Undefined variable $bbcode_bitfield

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
KungFuJosh
Registered User
Posts: 115
Joined: Sun Aug 21, 2016 1:26 am
Location: USA
Name: Joshua
Contact:

[phpBB Debug] PHP Warning: Undefined variable $bbcode_bitfield

Post by KungFuJosh »

I'm getting the following warning on a custom home page:

[phpBB Debug] PHP Warning: in file [ROOT]/home.php on line 143: Undefined variable $bbcode_bitfield

This just appeared today. No changes have been made to that page in a couple years, and the function it refers to is still working. I have recent active topics listed, and there's no issues with that, just the warning in the header.

This is line 143 and 144:

Code: Select all

         $bbcode = new bbcode(base64_encode($bbcode_bitfield));         
         $bbcode->bbcode_second_pass($post_text, $posts_row['bbcode_uid'], $posts_row['bbcode_bitfield']);
The recent topics list has 10 rows, and there are 10 errors, but all 10 topic rows appear as expected. No idea why this error decided to start showing up.

Was on phpBB 3.3.8, now on 3.3.9.

Thanks,
Josh
Last edited by KungFuJosh on Sat Dec 03, 2022 12:03 am, edited 1 time in total.
KungFuJosh
Registered User
Posts: 115
Joined: Sun Aug 21, 2016 1:26 am
Location: USA
Name: Joshua
Contact:

Re: [phpBB Debug] PHP Warning: Undefined variable $bbcode_bitfield

Post by KungFuJosh »

This is pretty stupid, but it got rid of the error. I added this with the other variable definitions:

Code: Select all

$bbcode_bitfield = "";
The code still works, and now no errors. 🙄
User avatar
[Dimetrodon]
Registered User
Posts: 438
Joined: Tue Aug 30, 2022 3:29 am
Location: Paleozoic Era
Contact:

Re: [phpBB Debug] PHP Warning: Undefined variable $bbcode_bitfield

Post by [Dimetrodon] »

You upgraded PHP, so some things are not backwards compatible. In that case, $bbcode_bitfield was probably defined somewhere else though the definition was not urgent, but for whatever reason, a small line of code that does that no longer works, requiring you to make that simple edit.

I didn't comment before because I'm a novice and I'm not exactly sure how your code works/what it does. That being said, minor fixes like that often comes with PHP updates. It's how a host forcing through an update can ultimately break an older board completely.
Avatar by someone named AdmiralRA on Reddit. (No, I don't have a Reddit account)
When seeking support, please consider filling out the Support Request Template. It makes it easier for anyone trying to help.
KungFuJosh
Registered User
Posts: 115
Joined: Sun Aug 21, 2016 1:26 am
Location: USA
Name: Joshua
Contact:

Re: [phpBB Debug] PHP Warning: Undefined variable $bbcode_bitfield

Post by KungFuJosh »

[Dimetrodon] wrote: Thu Dec 01, 2022 4:19 pm You upgraded PHP, so some things are not backwards compatible. In that case, $bbcode_bitfield was probably defined somewhere else though the definition was not urgent, but for whatever reason, a small line of code that does that no longer works, requiring you to make that simple edit.

I didn't comment before because I'm a novice and I'm not exactly sure how your code works/what it does. That being said, minor fixes like that often comes with PHP updates. It's how a host forcing through an update can ultimately break an older board completely.
That was a typo, sorry. I meant phpBB, not PHP. PHP is v7.x, nothing changed but the error was present on both versions of phpBB.
Post Reply

Return to “phpBB Custom Coding”