• Hello Edwiser Support Team,

    I am configuring the integration between WordPress and Moodle using Edwiser Bridge, but I am facing an error during the connection test.

    Currently, I am testing Moodle in a local environment. WordPress is on the same network, but on a different machine.

    Versions used:

    • Edwiser Bridge: 4.3.0
    • Moodle: 5.1.4

    The initial connection between Moodle and WordPress seems to be working, but the error occurs during the enrollment test step. After temporarily adjusting the Moodle log settings to better analyze the request, I identified that the parameters sent to the enrollment function are arriving incorrectly.

    The generated log was:

    PARAMS: Array
    (
        [wstoken] => ***TOKEN_REMOVED***
        [wsfunction] => enrol_manual_enrol_users
        [moodlewsrestformat] => json
        [enrolments] => Array
            (
                [0] => Array
                    (
                        [roleid] => 5
                    )
    
                [1] => Array
                    (
                        [userid] => 0
                    )
    
                [2] => Array
                    (
                        [courseid] => 0
                    )
    
            )
    
    )

    The ***TOKEN_REMOVED*** value shown above was intentionally masked for security reasons. The actual token used during the test was correctly configured.

    As a result, Moodle returns the following message:

    {
      "exception": "core\\exception\\invalid_parameter_exception",
      "errorcode": "invalidparameter",
      "message": "Invalid parameter value detected"
    }

    Based on the expected structure of the enrol_manual_enrol_users function, the data should be grouped under the same enrollment index, containing roleid, userid, and courseid. However, in the log, they appear separated into different indexes, and the userid and courseid values are being sent as 0.

    I would like to check with you:

    1. Could this error be related to any required configuration in Edwiser Bridge on WordPress or Moodle?
    2. Is there any default course/user that needs to be configured for the enrollment test to work?
    3. Could this behavior indicate an incompatibility between Edwiser Bridge 4.3.0 and Moodle 5.1.4?
    4. Is there any specific guidance to fix the “Invalid parameter value detected” error during the enrollment test?

    Could you please advise which settings we should review to complete the integration correctly?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for sharing those detailed logs. They were very helpful in identifying exactly why you are seeing the “Invalid parameter” error.

    userid: 0 — The dummy test user (ebdummyuser) has either not been created in Moodle yet, or the Moodle user ID has not been saved in WordPress.

    courseid: 0 — No Moodle courses have been synced to WordPress yet, so there is no moodle_course_id available for the enrollment test.

    Please follow these steps in order:

    • Step 1: Run the Connection Test: Go to Edwiser BridgeSettingsConnection and click Test Connection. Why? This process creates the ebdummyuser in Moodle and links its ID back to WordPress. Without this, the enrollment test has no “user” to attempt to enroll.
    • Step 2: Sync Your Courses: Go to Edwiser BridgeSynchronization and run Sync Courses from Moodle. Why? You need at least one Moodle course synced to WordPress so the plugin has a valid courseid to use for the test.
      • Note: The status of the course must be publish.
    • Step 3: Retry the Enrollment Test: Once the connection is verified and at least one course is synced, try the enrollment test again. It should now be able to pull the correct IDs instead of defaults.

    Note on Security: If you continue to see issues after following these steps, please do not share any sensitive site details here. Instead, you can send your updated logs to our technical team at [email protected] so we can investigate further in a secure environment.

    Let us know how it goes!

    Thread Starter brunounesc

    (@brunounesc)

    Hello,

    I apologize for the previous description. I had previously mentioned that the error was related to enrollment because, when analyzing both the WordPress test and the Moodle logs, the failure occurs during the default enrollment process used by Edwiser Bridge to validate the connection.

    However, to clarify, the error occurs specifically during the connection test between WordPress and Moodle.

    The logs shared earlier were generated during this connection test.

    I would also like to add one more detail: when analyzing the browser’s Network tab, I noticed that the request with the action eb_enroll_dummy_user returns the status error, and it is the only request that fails during the test.

    This matches the enrollment error log previously shared.

    Thank you.

    Hello,

    Thank you for the additional clarification. Since the error specifically occurs during the eb_enroll_dummy_user action in the connection test, we need to look closer at your site-specific environment.

    To help us investigate this further, could you please perform the following:

    1. Record a Video: Please share a screen recording of the connection test process with the Network tab open, so we can see the exact response headers and body for the failed request.
    2. Raise a Support Ticket: Please contact our technical team by submitting a ticket or emailing us at [email protected].

    In your email, please mention this forum thread and provide further details following the video.

    We look forward to resolving this for you!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.