Skip to:
Content
Pages
Categories
Search
Top
Bottom

Installation on OpenShift


  • oldshaghat
    Participant

    @oldshaghat

    Redhat’s Openshift has a nice WordPress option which was how I found bbPress. However, I am seeing that when deployed on openshift, the URL that the page ends up using to obtain the default bbPress theme data seems to be looking in the wrong spot.

    The root page is looking at mydomain/var/lib/openshift/longHexKey/app-root/data/plugins …
    This yields a 404 for the bbpress.css file and editor.js.

    whereas if I change that to mydomain/wp-content/plugins …
    The file comes back correctly.

    I’m just starting to get things going here with this stack so I’m not sure if this is a bbPress thing, a WordPress thing, or an OpenShift thing, but other plugins seem to be doing it ok. Is there a straightforward edit I can make to the bbPress files?

Viewing 6 replies - 1 through 6 (of 6 total)
  • bbPress queues up its CSS stylelsheet using WordPress’ standard functions wp_enque_stylesheet() so it shouldnn’t cause any issues.

    I’ve never tried Redhat’s Openshift, nor even knew it was a thing until now.

    Do they use a “standard” copy of WordPress or is it modified somehow?

    What versions of WordPress and bbPress are you having this issue with?


    oldshaghat
    Participant

    @oldshaghat

    I’m seeing this in WordPress 4.5.3 and bbPress 2.5.10.


    oldshaghat
    Participant

    @oldshaghat

    I dug down into bbpress/includes/core/template-functions.php and inspected a couple of variables there in the enqueue_script call to see what’s going on.

    $content_dir (from the constant ‘WP_CONTENT_DIR’) resolves as:
    /var/lib/openshift/hexkey/app-root/data/current/wp-content

    content_url gives mydomain/wp-content

    and the file location starts out as :
    /var/lib/openshift/hexkey/app-root/data/plugins/bbpress/templates/default/js/editor.js

    So the string replace is going to fail – because that constant content-dir isn’t where you expect it to be – which is maybe something stupid openshift has done. Or goodness knows.

    Seems like if I edit this file to trim the “current/wp-content” piece off the content dir location I’ll be in business.

    $content_dir (from the constant ‘WP_CONTENT_DIR’) resolves as:
    /var/lib/openshift/hexkey/app-root/data/current/wp-content

    content_url gives mydomain/wp-content

    and the file location starts out as :
    /var/lib/openshift/hexkey/app-root/data/plugins/bbpress/templates/default/js/editor.js

    That last path, I’d expect that to be /var/lib/openshift/hexkey/app-root/data/wp-content/plugins/bbpress/templates/default/js/editor.js

    i.e. after data is wp-content which is before plugins

    Plugins are “typically” installed unto the wp-content directory, WordPress has some constants available to change these, typically WP_CONTENT_DIR and WP_CONTENT_URL are used, WP_PLUGIN_DIR and WP_PLUGIN_URL are not used anywhere near as much, maybe the Openshift configuration has these defined in the wp-config.php file in the root directory?

    https://codex.wordpress.org/Determining_Plugin_and_Content_Directories#Constants

    This probably needs further investigation by bbPress, mainly to check the constants WP_PLUGIN_DIR and WP_PLUGIN_URL so these can be used standalone when WP_CONTENT_DIR and WP_CONTENT_URL are not used at all.


    @oldshaghat
    can you check in your wp-config.php if any of the above constants are defined please?


    oldshaghat
    Participant

    @oldshaghat

    I found a old report of this bug :

    https://bbpress.trac.wordpress.org/ticket/2739

    So it’s a known issue. My workaround (manually hacking the str_replace) seems to work so I’ll just manage that until it gets solved.

    @oldshaghat Ha, there we go, on our bug tracker already, glad we were on the right path at least. Great either your workaround or the one mentioned in the ticket until fixed 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar