kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

The resource isn't added to the lesson on the preview page after clicking on the "Add" button

Open ghost opened this issue 6 years ago • 3 comments

Environment; Raspberry Pi 3B+ OS: Kolibri 0.14.3 tested on Mac mini (Mid 2011) macOS Sierra v 10.12.6 Browser: Google Chrome latest

Severity; critical

Preconditions; user is logged in as a coach, Class home page is opened; at least one lesson is created

Steps to reproduce;

  1. Proceed to the Reports>Lessons page
  2. Click on any lesson
  3. Click on the "Options" dropdown
  4. Click on the "Manage Resources" button
  5. Proceed to the preview page for the selected resource
  6. Click on the "Add" button
  7. Come back to the previous page
  8. Pay attention to the item which you added from the preview page

Actual result: The resource isn't added to the lesson on the preview page after clicking on the "Add" button Expected result: The resource should be added to the lesson on the preview page after clicking on the "Add" button

Attachment: http://e.pc.cd/pFbotalK

ghost avatar Oct 19 '20 17:10 ghost

I had to update the OP, because a critical detail was inaccurate. I believe that when entering into this workflow from Plan > Lessons, things have been fixed recently. However, when entering into the workflow from Reports > Lessons (as in the attached video), adding a resource from the preview fails.

See this resource as an example.

Clicking "Add" does now does not navigate away from the page and you see this error in the console.

Uncaught (in promise) TypeError: Cannot read property '_normalized' of null
    at normalizeLocation (vue-router.esm.js:967)
    at Object.match (vue-router.esm.js:1489)
    at VueRouter.match (vue-router.esm.js:2828)
    at HashHistory.History.transitionTo (vue-router.esm.js:2124)
    at HashHistory.push (vue-router.esm.js:2595)
    at vue-router.esm.js:2913
    at new Promise (<anonymous>)
    at VueRouter.push (vue-router.esm.js:2912)
    at Sub.handleAddResource (PlanLessonSelectionContentPreview.vue:98)
    at invokeWithErrorHandling (vue.runtime.esm.js:1854)
    at Sub.invoker (vue.runtime.esm.js:2179)
    at invokeWithErrorHandling (vue.runtime.esm.js:1854)
    at Sub.Vue.$emit (vue.runtime.esm.js:3888)
    at Sub.addResource (index.vue:207)
    at invokeWithErrorHandling (vue.runtime.esm.js:1854)
    at Sub.invoker (vue.runtime.esm.js:2179)
    at invokeWithErrorHandling (vue.runtime.esm.js:1854)
    at Sub.Vue.$emit (vue.runtime.esm.js:3888)
    at Sub.handleClick (KButton.vue:142)
    at invokeWithErrorHandling (vue.runtime.esm.js:1854)
    at HTMLButtonElement.invoker (vue.runtime.esm.js:2179)
    at HTMLButtonElement.original._wrapper (vue.runtime.esm.js:6917)
    at HTMLButtonElement.sentryWrapped (helpers.js:70)

The traceback points to PlanLessonSelectionContentPreview.vue:98 where a computed prop returnBackRoute is null

jonboiser avatar Oct 19 '20 17:10 jonboiser

Screenshot_2020-10-22 Learners - First Lesson - New class - Kolibri

@jonboiser This still exists if you go from the Reports > Lessons > Learners tab and you press Manage Resources then you get ?last=ReportsLessonLearnerListPage. I think you should add a check for that also. :)

alexMet avatar Oct 22 '20 08:10 alexMet

@alexMet Thanks for pointing that out. So I think I need to add another line to my hack in 255149d to handle that page.

jonboiser avatar Oct 22 '20 17:10 jonboiser