Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Changing Environments with Publisher Lite and Problems with Structure

Status Resolved
Add-on / Version Publisher Lite 0.98.8
Severity Trivial
EE Version

Blis Web Agency

Jun 21, 2013

Hi Brian,

It might be a bit unfair to categorise this one as a “bug” but here’s the problem:

We’ve got a Site (2.6.1) running on the Newism Bootstrap with Structure (3.3.10) and Publisher Lite (0.98.8).

We do all our work on a Staging environment and then push this across (files and db) to Production.

When we do this, Structure is still pointing to all of our Staging URLs which didn’t used to happen. We figured out this was because Publisher Lite has the URL defined in a JSON array in exp_publisher_site_pages.

Does the URL string need to be defined in the JSON array? Without publisher it didn’t mater what domain we pointed at the site, it all just worked (thanks to the bootstrap). I was thinking if Publisher could reference the site URL via the global variable (site_url) rather than having it hard coded in the string, it would make it a little more flexible.

What do you think? Is this possible?

Thanks for you help.

Sam

#1

BoldMinded (Brian)

Even though Publisher has the url set in the site_pages array, its overridden and set properly later on (or should be anyway). To test this I added :8080 to my dev URL in the config file and the Structure navigation still worked. I assume that bootstrap sets the site_url variable somewhere? I can’t see it because ee-garage.com can’t find any pages relating to that add-on.

I’m going to send you the 0.99 build just incase to make sure we’re on the same page.

#2

Blis Web Agency

Thanks Brian. Version 0.99 didn’t change anything unfortunately.

You probably don’t need it but the Newsim Bootstrap is located here: http://ee-garage.com/nsm-config-bootstrap and the raw source is found here: https://gist.github.com/leevigraham/448166/raw/config_bootstrap.php

Getting back to the problem, I’ve found the spot which is causing me problems.

in Models/Publisher_Site_Pages.php the get() function is referencing the URL value directly from the database and which is obviously later being used to string together an absolute URL output in Structure. Because this value is set to the wrong domain when I move my database around, I’m getting the wrong values being outputted.

I found that by adding the following code on line line 695 it addresses the problem of changing domains.

$this->cache[‘site_pages’][1][‘open’][1][url] = ee()->config->item(‘site_url’);

The end result is exactly the same as if I were to edit an entry on my new domain and save it. Only this way, I don’t have to do that which is better (for me) given we don’t “edit” on the Production environment.

Any chance you’re prepared to include this (or something like it) in a upcoming version?

Thanks for your help.

Sam

#3

BoldMinded (Brian)

Sam, thanks for the info, but I think setting the URL on line 695 is too early. Can you try this change instead? I’m assuming you dont have URL Prefixing enabled?

https://www.evernote.com/shard/s9/sh/51baafd3-29a7-485a-9d95-7d0235961a60/eafbad54ef2e7af132a26ed177de3ab6

#4

Blis Web Agency

Perfect! That fixes a CP warning that was popping up after implementing my suggestion too. Thanks Brian, really appreciate you accommodating this for us.

Login to reply