michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
339 stars 71 forks source link

Incompatibility of metabox in admin pages when moving to PHP 8 #290

Closed SUGO-es closed 3 years ago

SUGO-es commented 3 years ago

Type of issue

Prerequisites

Steps to reproduce the issue (for Bug report)

  1. Look at the code I give you below, run it in PHP 7.4, the code works fine.
  2. Switch to PHP 8, in my case I am testing on PHP 8.0.3
  3. The metabox will stop rendering ...

Expected behavior and actual behavior

I am looking at possible incompatibilities to move some of my clients from php 7.4 to php 8, the tests I have done so far show me a significant increase in performance and are encouraging me to make the move from PHP 7.4 to PHP 8.0.3.

When changing the version of php I realized that the metaboxes that I had created in pages without tabs disappeared, the pages that have tabs, curiously, render them well.

I have tried searching within the code but can't find the reason.

Could you look at this incompatibility with PHP 8 what is it due to?

I am not getting any php error or warning, I find it very strange ...

I attach a small plugin with an example of yours on how metaboxes work on pages:

test-page-metabox.zip

Environment

Browsers

Operating System

Versions

Isolating the problem

michaeluno commented 3 years ago

I could confirm this behavior.

Thanks for the report.

SUGO-es commented 3 years ago

Hi micheluno,

I have fixed this solution in the base plugin and in my compilation and everything seems to work correctly.

Thank you very much for your prompt attention.

Best regards..