I am having issues with links in text box units for Coursepress Pro

When I try to add a link to an image or line of text within the units text box, the link doesn't work. Only links to other pages of the site aren't working. Outside links to other websites work fine.

I have tried to use the full URL and just the page title. After I save it, it automatically adds two dots at the beginning of the URL I just entered. When I preview and click the link, it just adds the URL on top of the existing page.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi there, Chris!

    It looks like some of your screenshots aren't uploaded here, but let's try a few things.

    First, can you try temporarily switching to a default WP theme and see if you can click/add internal links to images and units in CoursePress?

    Next, are you using any caching or security plugins? If so, can you try temporarily disabling them and see if internal links work again?

    Next, I notice this is a staging site, per your Domain URL, can you double check to make sure internal links are only broken within CoursePress, and not sitewide?

    Thanks, chris!

  • Black Fox
    • The Incredible Code Injector

    I have deactivated every plugin and tested with the default wordpress theme and the issue is still happening. All other internal links are working. Coursepress Pro and the WPMU dev dashboard are the only plugins activated and I am using the coursepress theme.

    I only attached two screenshots. I will upload them again here

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hey, Chris! Thanks for adding that screenshot, it looks like the first one didn't take in your first post.

    I found the link you're talking about here, the button to go to the discussion for that topic doesn't link to the proper page.

    I'm not able to replicate this on my site (I created a discussion for a unit and linked to it within the unit.) Since you've already checked for a plugin conflict, that makes me think this could be a simple Permalinks issue. Can you try to resave your Permalink structure via Settings>Permalinks? You don't have to change anything, just hit save again. That *should* sort this out for you.

    Thanks, Chris!

  • Black Fox
    • The Incredible Code Injector

    I have tried saving permalinks and Ive done a lot of testing to figure this problem out. I have several other sites with coursepress pro installed (using the coursepress theme) and the same thing happens. When I add ANY link to an internal page inside the units, it doesn't work. I've tried this with just the page slug and the full URL.

    When I try to link any text or image, it automatically adds two dots to the beginning of the URL once I save it. When I click on it in the page, it just adds that URL to the end of the existing URL. This definitely looks like a plugin bug.

  • Bojan Radonic
    • Head of Support

    Hey there @chris_behnke,

    There is no need for you to send us credentials. You can grant us temporary admin access to your site by clicking "Grant Access" button in the WPMU DEV Dashboard Settings from the following path.

    Admin -> WPMU DEV -> Support -> Support Access Tab

    If you have not installed WPMU DEV Dashboard plugin yet, you can get it here: https://premium.wpmudev.org/project/wpmu-dev-dashboard/ and then allow access as per the above process.

    Best regards,
    Brian

  • Black Fox
    • The Incredible Code Injector

    Ok thank you. I have granted permission through the dashboard. I have done testing on other sites, and I have discovered that this issue is only happening with sites that I have in development with a temporary domain through wpengine. It works well with live sites, but I wasn't able to test with a normal sub-domain. This makes me think that it might happen on all sub-domains.

    Just to recap:

    Whenever I try to add the full URL, it just saves as the relative URL with two dots before it. No matter how I set it up, the same thing happens. It happens on all of the sites I have with temporary sub-domains through wpengine.

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hey there, chris!

    I just reproduced this on my multisite. For me, I got the following error to throw:

    Warning: Creating default object from empty value in /home/pinkunic/public_html/wp-content/plugins/coursepress/includes/classes/class.shortcodes.php on line 2995

    We'll mark this as a bug, with the following steps to reproduce:

    1. Create a discussion and link it to a course on a subsite.
    2. Add a link to the discussion in a course unit.
    3. Clicking link takes user to discussions page with no content and the above error.

    Thanks, chris!

  • Tyler Postle
    • CGO

    Hey Chris,

    Hope you're enjoying your weekend!

    I see the bug ticket is still open so I've commented on it to find out what the status is :slight_smile:

    With that said, it does look like 2 releases have been pushed since you made this thread(we're on 1.2.2.9) - do you mind updating and see if it's been resolved. It's possible the bug ticket just never got closed.

    Look forward to hearing back here Chris!

    All the best,
    Tyler

  • Black Fox
    • The Incredible Code Injector

    Hey thanks for the response. I updated to version 1.2.2.9 of Coursepress Pro and this is still happening.

    I cannot link to any page under a sub-domain inside a text box element. Regardless of what I try, everytime I save the unit it changes my link to the relative URL with two dots before it. When I click the link in the page, it just adds that URL to the end of the existing page's URL and goes nowhere.

    I am working on a course that has specific questions tied to each page of a unit. I want to add a button to the discussion topic for each page.

  • Rheinard
    • The Incredible Code Injector

    Hi @chris_behnke,

    I've also been trying to reproduce this issue, but unsuccessful. Unless I manually use the relative URL. Any possibility that your theme doesn't filter content and remove absolute URLs? Or even an SEO type plugin?

    Alternatively, could you please send in your wp_config.php file? Feel free to remove the DB pass, I don't need this.

    Please do the following:

    - Mark to my attention - ATTN: Rheinard Korf
    - Link back to this thread
    - Include your config file

    Then, on the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    Cheers,
    Rheinard

  • Rheinard
    • The Incredible Code Injector

    Hi @chris_behnke,

    Just letting you know that I am still looking into this for you. Your wp-config.php doesn't have anything out of the ordinary in there.

    It is puzzling me as to why your internal URLs are being turned into relative URLs.

    I'll ask some of our SLS (Second Level Support) guys to also look at this.

    I appreciate your patience.

    Cheers,
    Rheinard

  • Rheinard
    • The Incredible Code Injector

    Hi @chris_behnke,

    I can confirm that this is a result of WP Engine turning absolute URLs into relative URLs. I've just tested on a WP Engine install and the same things happens.

    Now that I've got it narrowed down to this, I will see what we can do to work with this issue.

    Thank you for your patience. I hope that I can have some good news for you soon.

    Cheers,
    Rheinard

  • Rheinard
    • The Incredible Code Injector

    Hi @chris_behnke,

    Just letting you know that this one hasn't gone unnoticed. Apologies for the delay here. Its an odd issue. From some testing the best way to try and avoid this is to not use the visual editor, but that defeats the purpose and is not fail proof.

    Will keep you posted.

    Cheers,
    Rheinard

  • Rheinard
    • The Incredible Code Injector

    Hi @chris_behnke,

    I believe this problem is fixed now. I've tested it on WPEngine and the URLs are staying absolute now... even if adding media from the library.

    The fix will be pushed out with version 1.2.3.7.

    Cheers,
    Rheinard

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.