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

Adding custom attributes to lesson block causes infinite loop on Update #7109

Open
chvillanuevap opened this issue Aug 17, 2023 · 0 comments
Labels
[Pri] Low Cosmetic issue, low impact, easy workaround [Type] Bug

Comments

@chvillanuevap
Copy link

This is a weird bug and I'm not exactly sure why it is happening. It might be related to WordPress/gutenberg#16850 and PopupMaker/Popup-Maker#868. Updating a Lesson post from Sensei LMS Pro while any plugin that adds attributes to Lesson blocks (I tested Popup Maker and Attributes for Blocks) causes an infinite loop. I initially reported this to Popup Maker (PopupMaker/Popup-Maker#1052), but after having the same issue with Attributes for Blocks, I now realize it's a Sensei problem.

Steps to Reproduce

  1. Install Sensei Pro.
  2. Install either Attributes for Blocks or Popup Maker.
  3. Create a new lesson. Add a quiz with questions. For example:
<!-- wp:sensei-lms/lesson-actions -->
<div class="wp-block-sensei-lms-lesson-actions"><div class="sensei-buttons-container"><!-- wp:sensei-lms/button-view-quiz {"inContainer":true} -->
<div class="wp-block-sensei-lms-button-view-quiz is-style-default sensei-buttons-container__button-block wp-block-sensei-lms-button-view-quiz__wrapper"><div class="wp-block-sensei-lms-button-view-quiz is-style-default wp-block-sensei-button wp-block-button has-text-align-left"><button class="wp-block-button__link">View Quiz</button></div></div>
<!-- /wp:sensei-lms/button-view-quiz -->

<!-- wp:sensei-lms/button-complete-lesson {"inContainer":true} -->
<div class="wp-block-sensei-lms-button-complete-lesson is-style-default sensei-buttons-container__button-block wp-block-sensei-lms-button-complete-lesson__wrapper"><div class="wp-block-sensei-lms-button-complete-lesson is-style-default wp-block-sensei-button wp-block-button has-text-align-left"><button class="wp-block-button__link sensei-stop-double-submission">Complete Lesson</button></div></div>
<!-- /wp:sensei-lms/button-complete-lesson -->

<!-- wp:sensei-lms/button-next-lesson {"inContainer":true} -->
<div class="wp-block-sensei-lms-button-next-lesson is-style-default sensei-buttons-container__button-block wp-block-sensei-lms-button-next-lesson__wrapper"><div class="wp-block-sensei-lms-button-next-lesson is-style-default wp-block-sensei-button wp-block-button has-text-align-left"><button class="wp-block-button__link">Next Lesson</button></div></div>
<!-- /wp:sensei-lms/button-next-lesson -->

<!-- wp:sensei-lms/button-reset-lesson {"inContainer":true} -->
<div class="wp-block-sensei-lms-button-reset-lesson is-style-outline sensei-buttons-container__button-block wp-block-sensei-lms-button-reset-lesson__wrapper"><div class="wp-block-sensei-lms-button-reset-lesson is-style-outline wp-block-sensei-button wp-block-button has-text-align-left"><button class="wp-block-button__link sensei-stop-double-submission">Reset Lesson</button></div></div>
<!-- /wp:sensei-lms/button-reset-lesson --></div></div>
<!-- /wp:sensei-lms/lesson-actions -->

<!-- wp:sensei-lms/quiz {"options":{"passRequired":false,"quizPassmark":0,"autoGrade":true,"allowRetakes":false,"showQuestions":null,"randomQuestionOrder":false,"failedIndicateIncorrect":true,"failedShowCorrectAnswers":true,"failedShowAnswerFeedback":true,"buttonTextColor":null,"buttonBackgroundColor":null,"pagination":{"paginationNumber":null,"showProgressBar":false,"progressBarRadius":6,"progressBarHeight":12,"progressBarColor":null,"progressBarBackground":null},"enableQuizTimer":"","timerValue":null},"openPopupId":"1728855"} -->
<!-- wp:sensei-lms/quiz-question {"id":1610442,"title":"In Video 3, my nib kept catching on the paper and picking up fibers. What did I do to solve that problem?","answer":{"answers":[{"label":"I adjusted the brass flange of my oblique pen","correct":true},{"label":"I switched my nib","correct":false},{"label":"I started using a different ink","correct":false}]},"options":{"grade":1,"answerFeedback":"I adjusted the brass flange of my oblique pen so my nib met the paper at less of a severe angle. Having the ability to adjust the flange is a big perk of using the brass-flanged oblique pen! If you're using a straight pen, try adjusting how you hold the pen so you're able to achieve a writing angle that brings the pen closer to the paper. ","randomOrder":true}} -->
<!-- wp:sensei-lms/question-description -->
<!-- wp:paragraph {"placeholder":"Add question description or type / to choose a block."} -->
<p></p>
<!-- /wp:paragraph -->
<!-- /wp:sensei-lms/question-description -->

<!-- wp:sensei-lms/question-answers /-->

<!-- wp:sensei-lms/quiz-question-feedback-correct -->
<!-- wp:paragraph -->
<p>I adjusted the brass flange of my oblique pen so my nib met the paper at less of a severe angle. Having the ability to adjust the flange is a big perk of using the brass-flanged oblique pen! If you're using a straight pen, try adjusting how you hold the pen so you're able to achieve a writing angle that brings the pen closer to the paper. </p>
<!-- /wp:paragraph -->
<!-- /wp:sensei-lms/quiz-question-feedback-correct -->

<!-- wp:sensei-lms/quiz-question-feedback-incorrect -->
<!-- wp:paragraph -->
<p>I adjusted the brass flange of my oblique pen so my nib met the paper at less of a severe angle. Having the ability to adjust the flange is a big perk of using the brass-flanged oblique pen! If you're using a straight pen, try adjusting how you hold the pen so you're able to achieve a writing angle that brings the pen closer to the paper. </p>
<!-- /wp:paragraph -->
<!-- /wp:sensei-lms/quiz-question-feedback-incorrect -->
<!-- /wp:sensei-lms/quiz-question -->

<!-- wp:sensei-lms/quiz-question {"id":1726732,"title":"feawfew","answer":{"answers":[{"label":"aefewf","correct":true}]},"options":{"grade":1,"answerFeedback":"aefaewfaewf","randomOrder":true}} -->
<!-- wp:sensei-lms/question-description -->
<!-- wp:paragraph {"placeholder":"Add question description or type / to choose a block."} -->
<p></p>
<!-- /wp:paragraph -->
<!-- /wp:sensei-lms/question-description -->

<!-- wp:sensei-lms/question-answers /-->

<!-- wp:sensei-lms/quiz-question-feedback-correct -->
<!-- wp:paragraph -->
<p>aefaewfaewf</p>
<!-- /wp:paragraph -->
<!-- /wp:sensei-lms/quiz-question-feedback-correct -->

<!-- wp:sensei-lms/quiz-question-feedback-incorrect -->
<!-- wp:paragraph -->
<p>aefaewfaewf</p>
<!-- /wp:paragraph -->
<!-- /wp:sensei-lms/quiz-question-feedback-incorrect -->
<!-- /wp:sensei-lms/quiz-question -->

<!-- wp:sensei-lms/quiz-question /-->
<!-- /wp:sensei-lms/quiz -->
  1. Click Update.
  2. Update loops infinitely.

What I Expected

Update should also be called once.

What Happened Instead

Update is stuck in an infinite loop.

PHP / WordPress / Sensei LMS version

WordPress version: 6.3
PHP version: 7.4.30 (also tested on 8.1.9)
Popup Maker version: 1.18.2
Sensei LMS Pro version: 4.16.1

Browser / OS version

Google Chrome Version 115.0.5790.170 (Official Build) (arm64)

Screenshot / Video

Screen Recording 2023-08-15 at 10 53 25 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Pri] Low Cosmetic issue, low impact, easy workaround [Type] Bug
Projects
None yet
Development

No branches or pull requests

2 participants