Automattic / sensei

Sensei LMS - Online Courses, Quizzes, & Learning
https://senseilms.com
GNU General Public License v2.0
545 stars 199 forks source link

Cannot create lessons from course edit page with WPML active #5347

Closed cena closed 10 months ago

cena commented 2 years ago

See: 5302767-zen

When attempting to create a lesson from the course edit page, clicking on 'Save to Edit' leads to loading, then removal of that lesson from the module block:

https://user-images.githubusercontent.com/19334/178324697-2ce1b63e-56f5-4c99-8d69-e741976128b6.mov

Disabling WPML and going back to same course edit page now shows all the lessons I previously tried to create for this course: SCR-20220711-g6b

These lessons also appear in the Lessons->All list.

I can now create a new lesson correctly.

Re-enabling WPML and going back to same course list now shows ALL lessons created in Sensei:

SCR-20220711-gns

and now cannot create new lessons via 'Save and Edit'.


Maybe related:

Disabling the Avada-child theme didn't seem to have an effect after disabling WPML, until I tried editing lessons again from course edit page after re-enabling WPML, and that led to this error:

SCR-20220711-gp5

Disabling Avada Core & Avada Builder plugins removed it, and I was able to renable Avada-child without encountering the error again.

However, I also re-enabled Core & Builder afterwards and also haven't been able to duplicate error since.


EDIT: I was able to get a copy of WPML and install it on my test site. Once registered, I had access to their forums and found this related issue:

https://wpml.org/errata/cannot-add-a-quiz-question-in-sensei-when-wpml-is-active/

Although marked as 'resolved', they later say it's not, and to use this plugin for the interim:

WPML-Sensei-compatibility-master.zip

Installing this results in the following error when attempting to create a new course:

Fatal error: Uncaught Error: Too few arguments to function WPML_Sensei_Compatibility::wpml_save_post_trid_value_filter(), 2 passed in /wordpress/core/6.0.1/wp-includes/class-wp-hook.php on line 307 and exactly 3 expected
in [/srv/htdocs/wp-content/plugins/WPML-Sensei-compatibility-master/wpml-sensei-compatibility.php](vscode://file/%2Fsrv%2Fhtdocs%2Fwp-content%2Fplugins%2FWPML-Sensei-compatibility-master%2Fwpml-sensei-compatibility.php:35) on line 35

Call stack:

    [WPML_Sensei_Compatibility::wpml_save_post_trid_value_filter()](vscode://file/%2Fwordpress%2Fcore%2F6.0.1%2Fwp-includes%2Fclass-wp-hook.php:307)
    [WP_Hook::apply_filters()](vscode://file/%2Fwordpress%2Fcore%2F6.0.1%2Fwp-includes%2Fplugin.php:191)
    [apply_filters()](vscode://file/%2Fsrv%2Fhtdocs%2Fwp-content%2Fplugins%2Fsitepress-multilingual-cms%2Finc%2Fpost-translation%2Fwpml-admin-post-actions.class.php:42)
    [WPML_Admin_Post_Actions::get_save_post_trid()](vscode://file/%2Fsrv%2Fhtdocs%2Fwp-content%2Fplugins%2Fsitepress-multilingual-cms%2Fmenu%2Fpost-menus%2Fpost-edit-screen%2Fwpml-meta-boxes-post-edit-html.class.php:729)
    [WPML_Meta_Boxes_Post_Edit_HTML::get_trid()](vscode://file/%2Fsrv%2Fhtdocs%2Fwp-content%2Fplugins%2Fsitepress-multilingual-cms%2Fmenu%2Fpost-menus%2Fpost-edit-screen%2Fwpml-meta-boxes-post-edit-html.class.php:719)
    [WPML_Meta_Boxes_Post_Edit_HTML::get_translations()](vscode://file/%2Fsrv%2Fhtdocs%2Fwp-content%2Fplugins%2Fsitepress-multilingual-cms%2Fmenu%2Fpost-menus%2Fpost-edit-screen%2Fwpml-meta-boxes-post-edit-html.class.php:838)
    [WPML_Meta_Boxes_Post_Edit_HTML::init_source_element_data()](vscode://file/%2Fsrv%2Fhtdocs%2Fwp-content%2Fplugins%2Fsitepress-multilingual-cms%2Fmenu%2Fpost-menus%2Fpost-edit-screen%2Fwpml-meta-boxes-post-edit-html.class.php:755)
    [WPML_Meta_Boxes_Post_Edit_HTML::init_post_data()](vscode://file/%2Fsrv%2Fhtdocs%2Fwp-content%2Fplugins%2Fsitepress-multilingual-cms%2Fmenu%2Fpost-menus%2Fpost-edit-screen%2Fwpml-meta-boxes-post-edit-html.class.php:53)
    [WPML_Meta_Boxes_Post_Edit_HTML::render_languages()](vscode://file/%2Fsrv%2Fhtdocs%2Fwp-content%2Fplugins%2Fsitepress-multilingual-cms%2Fsitepress.class.php:2069)
    [SitePress::meta_box()](vscode://file/%2Fwordpress%2Fcore%2F6.0.1%2Fwp-admin%2Fincludes%2Ftemplate.php:1401)
    [do_meta_boxes()](vscode://file/%2Fwordpress%2Fcore%2F6.0.1%2Fwp-admin%2Fincludes%2Fpost.php:2303)
    [the_block_editor_meta_boxes()](vscode://file/%2Fwordpress%2Fcore%2F6.0.1%2Fwp-admin%2Fedit-form-blocks.php:314)
    [require()](vscode://file/%2Fwordpress%2Fcore%2F6.0.1%2Fwp-admin%2Fpost.php:187)

In addition, my course edit page (in block editor) says: Your site doesn’t include support for the "sensei-lms/button-take-course" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. This is using the Storefront theme.

So the above plugin, while not our problem, seems to be targeting non-block-based sites, which are no longer supported by Sensei.

Just noting for future reference.


WP: 6.1 SenseiPro 3.5.1.1.4.0 WPML: 4.5.8 Avada: 7.6

cena commented 2 years ago

Note: user ended up cancelling Sensei after a month of all of us (her and HEs) to get this worked out; there doesn't seem to be a good workaround here. :(

gikaragia commented 1 year ago

Maybe relates to https://github.com/Automattic/sensei/issues/2788

github-actions[bot] commented 1 year ago

Support References

This comment is automatically generated. Please do not edit it.

merkushin commented 10 months ago

Fixed here: https://github.com/Automattic/sensei/issues/6978