Templates Plugins Courses

Coursely - javascript issue when adding the video code for creating a lesson

Hi there.
I bought the coursely app.So when I deployed it and tried to ad a lesson of a course the app returns an error attached to this message. Can someone help fix this issue ?

16

Hi @kaile,

Thanks for reaching out. Let us check on this use case and I’ll get back to you asap.

Best,
Alex

Thanks @alexander

my status:

(1) Create a new app using the coursely template.
(2) Connecting the YouTube API to the bubble API connector.
(3) Run the test on the Instructor_profile page.
(4) Create a new course and click on “ADD LESSON”.
(5) When I try to save the data source to YouTube, I get a javascript error.

Also, when I deleted and executed “Run Javascript” in Workflow, no error appeared. (Of course, no duration is recorded.)

The code in Run Javascript is in its first state.

Hi @kaile, unfortunately this error is not reproducing on our side after test. Without knowing more about your settings and workflow, I can give a hint that might work. Please follow the instructions here https://docs.zeroqode.com/templates/coursely-online-learning-or-udemy-template where the only changes you need to make regarding plugins is the Stripe for payments. It is not required to adjust the API Connector as it is already configured on purchase. So the way things should work, is by creating a new app with this template, and give it a try in the version-test to add a lesson with Youtube as source.

In case you want to deploy with this changes to live for test, make sure that both database and the app itself are deployed.

However, if you still get any errors afterwards, please provide us with more details like screenshots/video of your app, workflow, and the problem itself, also the browser and OS you are using, Bubble version, console logs and the exact steps to reproduce again. So we could better investigate it and get back to you with a solution asap.

Hope it helps. Thank you for understanding.

Hello @alexander
I have tried everything you have given me and it has not worked :frowning:

My Info:
-MAC OS 10.15.3
-Google Chrome (latest version)
-Bubble version ? (I don’t know but I think it’s probably the latest version)

Steps to reproduce again:
1.LOGIN to Bubble
2.Select the NEW APP from Myapps.
3.Enter the “Name of this new app” and select Coursely from the template.
4.Click “CREATE A NEW APP”.
5.Close the Assistant and click PREVIEW.
– version test –
6.demo login
7.Go to the Instructor_page and click “Create New Course”
8.Add a section with an appropriate name.
9.Add a lesson. The video source should be YouTube and paste the appropriate YouTube link.
10.When I click on Add lesson, you will see the following error.

Event Button Add Lesson is clicked and Dropdown Choose Lesson Video Source’s value is YouTube

The service Youtubeb - Video duration just returned an error (HTTP 400). Please consult their documentation to ensure your call is setup properly. Raw error:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyInvalid",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}

11.From this, I thought it was necessary to set the key for the API connector.
12.Paste my api key into the “keyYoutube” (Plugins >> API Connector >> Youtube >> Video duration)
13.Execute the Reinitialize call and save (no change).
14.Try again, do steps 7 through 10.
15.When I click on Add lesson, you will see the following error.

Action Run javascript

The plugin Toolbox / action Run javascript threw the following error: TypeError: Cannot read property 'length' of null
at convert_time (eval at <anonymous> (PLUGIN_Toolbox-action--Run-javascript-.js), <anonymous>:17:11)
at eval (eval at <anonymous> (PLUGIN_Toolbox-action--Run-javascript-.js), <anonymous>:77:14) (please report this to the plugin author)

For the workflow, I’ll send you a screenshot of the Run javascript part.
As you know, I have not made any changes to the workflow.



If you want any information, let me know.

Thank you.

Hi @kaile, thanks for feedback. Unfortunately, this issue is still not reproducing on our side. However, based on the provided steps and the first occurring error regarding HTTP 400, the issue is on the step 9.Add a lesson. The video source should be YouTube and paste the appropriate YouTube link. It actually has to be only the video ID, rather than the whole Youtube link, which is why it’s throwing this particular error.

Here is a screenshot to showcase an Youtube video ID example, that has to be copied and inserted into your app:

image

Hope it helps!

Hi @alexander
Unfortunately, not worked :frowning:
I tested multiple URLs as instructed, and got the same error code (400 error).

Hi @kaile, thanks for feedback. Have you actually created a new app and followed the same steps without making any changes to the template? If so, and the error still occurs, please add our [email protected] account to your collaborators list within your app by going to Settings - Collaboration tab. You can ignore the warning message regarding plan, as we are an agency and you can easily add us. In this case, tell us the app name and page name where you are developing it and the issue occurs. We will check it inside and get back to you asap. Thanks!