*

gsmax

  • **
  • 5 posts
Hi there, I have a small issue with this overall great product!

apparently the osc_current_web_theme_url function does not render the assets urls properly so instead of the full path to my theme assets like:

sitename.com/oc-content/themes/epsilon/css/style.css

i'm getting urls like:

sitename.com/oc-contentthemesepsiloncssstyle.css

The "/" between the directories is missing for some reason. Not sure what the reason for that might be or how to fix it. Everything works on localhost btw. Also the admin works normally the issue is only on the frontend/theme part.

Does anyone has an idea? Thanks!



« Last Edit: February 02, 2023, 01:04:28 PM by gsmax »

*

MB Themes

Re: osc_current_web_theme_url does not render the assets url properly
« Reply #1 on: February 02, 2023, 05:06:39 PM »
@gsmax
Only what comes to my mind is that your base path (osc_base_path()) would be just "/" without quotes.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

gsmax

  • **
  • 5 posts
Re: osc_current_web_theme_url does not render the assets url properly
« Reply #2 on: February 03, 2023, 10:18:46 AM »
Hi @MB Themes

Thank you very much for giving me direction. Do you have an idea where I can check the "osc_base_path()"? That's a clean install btw.

The other weird thing is that "osc_current_web_theme_js_url" works just fine. I have all the JS files but images and CSS are missing.

Aren't both  "osc_current_web_theme_js_url" and "osc_current_web_theme_url" rely on "osc_base_path()" to generate the paths to the assets if I'm getting it right?


EDIT:

OK. Think I found the problem. In WebThemes.php inside the function "setCurrentThemeUrl" the  str_replace(osc_base_path(), ''  function  was missing / between the single quotes.

See below:

public function setCurrentThemeUrl()
  {
    if ($this->theme_exists) {
      $this->theme_url = osc_apply_filter('theme_url', osc_base_url() . str_replace(osc_base_path(), '/', $this->theme_path));
    } else {
      $this->theme_url = osc_apply_filter('theme_url', osc_base_url() . OC_INCLUDES_FOLDER . '/osclass/gui/');
    }
  }



Now it works. Is this plausible explanation in your opinion? Can I keep it like this?


Thanks for your support again. I highly appreciate it!





« Last Edit: February 03, 2023, 11:18:23 AM by gsmax »