trigger_error('NO_STYLE_DATA', E_USER_ERROR);

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
gedq
Registered User
Posts: 4
Joined: Tue Sep 02, 2014 12:43 pm

trigger_error('NO_STYLE_DATA', E_USER_ERROR);

Post by gedq »

I've woken up to a "NO STYLE DATA" which has killed my board. I've hunted for a solution here, tried deleting the contents of cache.

I've changed the line in user.php to

Code: Select all

if (!$this->style)
                {
                        # trigger_error('NO_STYLE_DATA', E_USER_ERROR);
                        trigger_error($this->data['user_style'], E_USER_ERROR);
                }
to give me the style id. It's trying to load style 15. There is no style 15, so I pick a style, set its id in the styles table to 15, delete all folders in /cache/ and that has fixed it.

For future reference and for prevention, does anyone have any idea what the heck caused that?

User avatar
EA117
Registered User
Posts: 1295
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: trigger_error('NO_STYLE_DATA', E_USER_ERROR);

Post by EA117 »

There is no "validation" at the time this check is being made. Meaning there is no check for whether the indicated style ID actually exists in the /styles/ directory, or has a valid style.cfg, etc. (i.e. Not like you or your hosting service accidentally deleted a /styles/ subfolder to cause this.) This check is purely about "does the indicated style ID exist in the phpbb_styles table."

So it does seem quite unusual that it would be "out of the blue" to no longer exist in the phpBB_styles table. Technically an extension has the opportunity to override the style_id value at the start of this logic, but that's before the tests that would make phpBB still fall back to using the board default style. So I don't think an extension could be giving you this invalid style ID; the style ID ultimately declared invalid has to be the current board default style ID, if not also the user selected style ID.

The place I would start is by looking at last week's or last month's database backup, and see what was in the phpbb_styles table then, and also what the phpbb_config table says the default_style was at that point. Maybe seeing what else has changed besides absence of style ID 15 will give some clues as to what kind of change(s) might have occurred.

User avatar
3Di
Former Team Member
Posts: 14810
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: trigger_error('NO_STYLE_DATA', E_USER_ERROR);

Post by 3Di »

Yeah, that's a very old story.

https://tracker.phpbb.com/browse/PHPBB3-16144
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Premium extensions @ The Studio

User avatar
EA117
Registered User
Posts: 1295
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: trigger_error('NO_STYLE_DATA', E_USER_ERROR);

Post by EA117 »

The way I read where the NO_STYLE_DATA notice is thrown in the current shipping code, the $this->style value which is being reported as invalid can already be the style ID from $config['default_style']. Indeed, for debugging purposes they changed their code to expose specifically what the $this->data['user_style'] value currently was, but it's not that we know $config['default_style'] wasn't also style ID 15.

Just saying that a code change to "replace user_style with the board default_style" does sound fine, and should be helpful to any case where only the user-specified style is now missing from the database. But it's not that we've investigated far enough yet to know whether that even would have helped in this particular case?

User avatar
3Di
Former Team Member
Posts: 14810
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: trigger_error('NO_STYLE_DATA', E_USER_ERROR);

Post by 3Di »

As of 3.2.8 the admin will be badly noticed in ACP if a style is missing
https://github.com/phpbb/phpbb/pull/5654

To add, I strongly believe the default style has a wrong ID?

Edit: hardened the whole stuff anyway.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
:studio_microphone: Premium extensions @ The Studio

Post Reply

Return to “[3.2.x] Support Forum”