LearnPress / learnpress

LearnPress WordPress LMS Plugin by ThimPress
https://thimpress.com/learnpress
241 stars 140 forks source link

lessons or quizs not display in edit course page #530

Closed Dguesdon closed 1 year ago

Dguesdon commented 1 year ago

the lessons and quizs under the chapters on the course editing page cannot be displayed. the questions are display on the quizs editing page. But when i tried the quiz in the course it says the course doesn't exist or haven't quiz. When I check mysql, lessons and quizs are associated with the course, but they are not displayed.

I cloused all plugins

wordpress version: 6.0.3 learnpress version: 4.1.7.2

I tried to create new course with new lessons and quizs but there are the sames maters. I tried to update learnpress in the last version ( 4.1.7.3.2) and it doesn't change anything.

tungnxt89 commented 1 year ago

Hi Dguesdon,

On the backend, have you encountered any errors about notice wp_remote_get? Lik the image

You can try version beta 4.2.0-beta-7. Then feedback us.

Thanks.

seniorcat commented 1 year ago

Hi! I get exactly the same error, some research led me to the fact that the record in the database for the fast query _lp_info_extra_fast_query is not updated

And yes, the wp_remote_get error is present

tungnxt89 commented 1 year ago

Hi seniorcat,

Yes, you need to fix it, it will run right. Can you send us the image error?

Thanks.

seniorcat commented 1 year ago

image

On the local machine I have this error and the lessons are not displayed in the course after refreshing the page, on the prod site there is no error, but the lessons are still not displayed. If I delete the _lp_info_extra_fast_query line from the database, then everything starts working correctly, I have been observing this behavior after version 4.1.6.4

tungnxt89 commented 1 year ago

Hi seniorcat,

Yes, "_lp_info_extra_fast_query" makes the query super fast; it doesn't need the query to join many tables to get the list. WP's default remote get function runs normally most of the time, but it does not always because the SSL configuration is incorrect or something else. LP needs to use that for running some background functions. Curl is used before wp_remote_get, but some servers disable it by default. So currently, we don't have a choice for another solution. If you know, please contribute to us.

Are you use localwp to run the server locally?

Thanks so much.

seniorcat commented 1 year ago

I found a bug in my environment, since the site is running in docker, it was accessing localhost. I reconfigured the host of my local site and added an alias to the nginx container so that it can be accessed from the php container at the address Thanks for your hint!