Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Warning with Divi and LM's Video theme #6492

Closed
aaronfc opened this issue Feb 6, 2023 · 3 comments · Fixed by #6803
Closed

PHP Warning with Divi and LM's Video theme #6492

aaronfc opened this issue Feb 6, 2023 · 3 comments · Fixed by #6803

Comments

@aaronfc
Copy link
Contributor

aaronfc commented Feb 6, 2023

A PHP warning is generated when accessing Divi's editor when Learning Mode is enabled and "Video" theme is selected.

Originally reported by @renatho in #6451 (review)

Steps to reproduce

  • Enable LM
  • Choose "Video" theme (Sensei Pro)
  • Install and enable Divi
  • Enable Divi integration with Lessons
  • Create a course, with some lessons.
  • Go to edit the Lesson with Divi editor.

Expected

No PHP warning to appear.

Actual

The following PHP Warning is registered (confirm that WP_DEBUG is enabled):

[31-Jan-2023 21:49:54 UTC] PHP Warning:  Trying to access array offset on value of type null in /var/www/html/wp-includes/class-wp-block-supports.php on line 98

Extra context

@renathoc and me did some extra investigation and apparently this has to do with the fact that Video template contains a exceprt block.

We could "workaround" the warning by:

  • Adding some excerpt to the lesson content (at the sidebar in the admin editor).
  • Removing the <!-- wp:post-excerpt /--> block using the full site editor from the lesson template for Video theme.

Additionally, we have faced already issues related to "the excerpt" for Divi before and also for Yoast.

@m1r0
Copy link
Member

m1r0 commented Apr 11, 2023

Could someone please confirm that this is still an issue? I wasn't able to reproduce it.

I've tested on:

  • Divi: 4.14.6
  • Sensei LMS: trunk
  • Sensei Pro: trunk
  • WP: 6.2

@m1r0 m1r0 removed their assignment Apr 11, 2023
@renatho
Copy link
Contributor

renatho commented Apr 11, 2023

Hi @m1r0! I'm still able to see the warning. I don't see it on the page anymore, but I can see it in the debug.log.

About versions, I'm with the same versions as you in Sensei LMS, Sensei Pro, and WP, but I needed to update the Divi to 4.20.4 because it wasn't working for some reason.

Did you activate the lessons here?

Screenshot 2023-04-11 at 16 10 53

@m1r0 m1r0 self-assigned this Apr 11, 2023
@m1r0
Copy link
Member

m1r0 commented Apr 11, 2023

It turned out the error is only visible on PHP 7.4+ but I was testing on PHP 7.2.

Thanks @renatho. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants