Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Preview Problems multsite

jonny's Avatar


08 Nov, 2013 10:29 AM

We purchased your plugin and it works very well apart from the preview as I thought it might. We get a 404 on all pages but the home page. Hope I can briefly pick your brains and you can point me in the right direction, I don't mind tweaking things.

I'll give you a brief overview of our site:

The site is a multisite EE install with six sites and they are accessed using urls such as:

This is the british swimming multisite of course!

Here's a quick example of my issue. The preview for better workflow uses the following url, which in our template system will return a 404, I've selected the "news/index" template in the BW settings which is correct:

Better Workflow Preview [URL:]

The actual url to make the page work would be:

This calls the "new/index" template within british swimming and we called the shared templates in the default_site.

{embed='default_site:_swimkit_system/index' channel="news"}

Hope I'm not confusing matters but I basically need a way to pass these urls to your preview!

EE - 2.7.2
BW - 1.6.3
PHP - 5.3.15
Third party extras - matrix, assets, wygwam

Thanks Jonny

  1. 1 Posted by jonny on 08 Nov, 2013 04:39 PM

    jonny's Avatar

    Is there anybody out there!!!

  2. Support Staff 2 Posted by Malcolm Elswort... on 09 Nov, 2013 01:43 PM

    Malcolm Elsworth's Avatar

    Hi Jonny,

    Sorry for the slow response.

    When using MSM, Better Workflow uses the site_url as specified in the site's config file as the base for the preview. You seem to be using the first segment as the site identifier rather than different URLs. I'm guessing all your routing is performed at template level?

    Do all your sites have the same URL in their configs? Is it possible to use the url + first segment?

    I have to confess I've never seem an MSM installation set up like this. It may require an additional value to be added to each site's config, something like:

    $config['bwf_preview_base_url'] = '';

    Let me know if you can resolve this by updating the site_url value, if not we can look into making some changes.


  3. 3 Posted by jonny on 22 Nov, 2013 09:53 AM

    jonny's Avatar

    Thanks for getting back Malcolm yes routing is done at template level and it's a legacy issue as the site used something called kit system which used categories for routing. Bit of a nightmare really.

    I'll give your suggestion a try.

    Many thanks

  4. Support Staff 4 Posted by Malcolm Elswort... on 22 Nov, 2013 12:22 PM

    Malcolm Elsworth's Avatar

    Good luck, hope you manage to get this working - let me know if we can help further.


  5. 5 Posted by jonny on 23 Jun, 2014 03:34 PM

    jonny's Avatar

    Hi Malcolm

    This issue has reared it's head due to the client requesting it:

    You mentioned the preview used the config site url.

    We have the above in our root index file:

    $assign_to_config['site_url'] = $server_name . SKYLAB_SITE_FOLDER;

    And in each sites index.php we have:

    define('SKYLAB_SITE_FOLDER', '/britishswimming/');

    Which generates:

    I've noticed when trying to preview it doesn't use the site url value, for instance:

    So it doesn't seem to be using the site url.

  6. 6 Posted by Rob Hodges on 24 Jun, 2014 10:51 AM

    Rob Hodges's Avatar

    Hi Jonny,

    Can you try using the advanced BWF conditional: bwf_preview_site_url in this format:

    /* Better Workflow preview URLS */ $assign_to_config['bwf_preview_site_url'] = array( '1' => '', '2' => '', '3' => '' );

    Where 1,2,3 correspond to the MSM site_id?



  7. 7 Posted by jonny on 24 Jun, 2014 11:02 AM

    jonny's Avatar

    Thanks for getting back, will give that a go.

    To create our custom urls I'm having to update your preview.js file and update the preview url with our category driven one. I'm getting there though.

  8. 8 Posted by jonny on 25 Jun, 2014 08:55 AM

    jonny's Avatar

    Just a another query, how do you get the latest version to show in the preview. I've obviously got the correct page to show but it's the saved version not the draft!!!

  9. 9 Posted by jonny on 26 Jun, 2014 08:27 AM

    jonny's Avatar

    I think there's a few issues with the saving of the entries. When your plugin saves the preview on a new entry it gives the incorrect entry back and then breaks on close.

    The entry id it's giving me is an entry already in the database associated with another site in the multisite.

    [Log] Saved data: 20261 (preview.js, line 183) [Error] Failed to load resource: the server responded with a status of 500 (Internal Server Error) (admin_h7T5fV47.php, line 0) [Error] Internal Server Error,{error;

    You have tried to access a channel that does not exist.<\/p>"} (anonymous function) (admin_h7T5fV47.php, line 388) (anonymous function) (admin_h7T5fV47.php, line 360)

  10. Support Staff 10 Posted by Malcolm Elswort... on 26 Jun, 2014 12:02 PM

    Malcolm Elsworth's Avatar

    Hi Jonny,

    I'm sorry you are having problems with BWF.

    To help you resolve your issues we are going to need a lot more information. Please read the notes on support on our website and make sure you supply all the information requested:

    There are a number of reasons why you are seeing the live version in the preview window rather than the draft: - for example you might be failing the validation process.

    To help us debug can you enable logging in BWF and then try a single preview. Then go back to the BWF settings page and view the log. Look for references to authentication and paste these into a ticket.

    As for your other issue, again we need to know a lot more before we can help you. Please describe the exact steps you follow to receiving this error and ensure that you can reliable replicate it.

    Many thanks,

  11. 11 Posted by jonny on 27 Jun, 2014 10:28 AM

    jonny's Avatar

    Hi Malcolm

    Thanks again, I've attached the log file.

    I have the preview button showing the live preview but obviously the draft is neither displaying or saving to the entry revision.

    All I've done to change the preview.js is created a custom string with our category powered structure. And replaced this line:

    //buttonValue = this.transition.baseURL + buttonValue; /**** CUSTOM URL HACK ****/ buttonValue = customUrl;

  12. Support Staff 12 Posted by Malcolm Elswort... on 30 Jun, 2014 08:31 AM

    Malcolm Elsworth's Avatar

    Hi Jonny,

    BWF Drafts are not the same as EE Entry Versions - they are an entirely different entity.

    You only create a BWF Draft once you have a live entry and make changes to it. To check these are being created you must look in the ep_entry_drafts table your DB for a record with the same entry ID as your EE Entry.

    If it is there BWF is working. If you can't see this version in your preview there is a problem with your template.

    If you can't see it in the publish view there is probably a compatibility issue with another extension.

    Please check this and let me know.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac