RW 7, Sitelok, PowerGrid CSV

I have been using Sitelok for a Students Only section of my website. After upgrading to RW7, I cannot preview my pages in RW if the necessary Sitelok php prefix is present in the prefix code section of individual pages. If I remove the code, I can preview the pages. If I remember correctly this happened in RW6 as well, but was corrected soon after release.

Additionally, I get an error when trying to preview a page that utilizes Joe Workman’s PowerGrid CSV stack, set to display Google Sheet data. The error is this:

Fatal error: Uncaught exception ‘UnexpectedValueException’ with message ‘RecursiveDirectoryIterator::__construct(RapidWeaver/): failed to open dir: No such file or directory’ in /private/var/folders/yd/m_09cvbn7zgc9z5b64y07hdw0000gn/T/com.realmacsoftware.rapidweaver/RapidWeaver/62647/document-0x7fa9087c8ea0/RWDocumentPagePreview/biography/index.php:85 Stack trace: #0 /private/var/folders/yd/m_09cvbn7zgc9z5b64y07hdw0000gn/T/com.realmacsoftware.rapidweaver/RapidWeaver/62647/document-0x7fa9087c8ea0/RWDocumentPagePreview/biography/index.php(85): RecursiveDirectoryIterator->__construct(‘RapidWeaver/’) #1 /private/var/folders/yd/m_09cvbn7zgc9z5b64y07hdw0000gn/T/com.realmacsoftware.rapidweaver/RapidWeaver/62647/document-0x7fa9087c8ea0/RWDocumentPagePreview/biography/index.php(113): locate_preview_asset(‘…’) #2 /Applications/RapidWeaver include(’/private/var/fo…’) #3 {main} thrown in /private/var/folders/yd/m_09cvbn7zgc9z5b64y07hdw0000gn/T/com.realmacsoftware.rapidweaver/RapidWeaver/62647/document-0x7fa9087c8ea0/RWDocumentPagePreview/biography/index.php on line 85

Any idea what is going on here?

I’m seeing the same thing. Rather then temporarily commenting out the code (which I might forget to uncomment out), I add a 1 column stack to the bottom of the page. Into it goes a headline of “PUT THIS BACK” and a locker stack into which the actual code goes. That way, when I preview my work, I’ll see the headline, but the Sitelok code isn’t interfering with the page until I’m ready to publish again. A bit of a pain, but it works.


At least there is a workaround for the Sitelok problem. I have found none for the PowerGrid CSV issue. Just adding PowerGrid CSV and changing nothing in the inspector causes the fatal error.

1 Like

There was a PowerGrid update waiting for me this morning - maybe this has been addressed? Don’t know for sure because I haven’t upgraded yet.

1 Like

No, that PowerGrid CSV update did not do the trick.

We published a short article on the issue with SiteLok here:

Will work with @joeworkman to find out what the issue with PowerGrid CVS is, I’m sure it’ll be something we can fixed between us!


And, being that it’s Joe Workman, we can certainly expect a revised edition as soon as he resolves the issue. He’s never one to wait and bundle a whole bunch of things together into an upgrade…when he improves a stack, he releases it immediately. Just one of the reasons I love buying his products.

Check for updates! PowerGrid CSV will preview again. Thanks for finding this!


It would be great if there were some better workaround for Sitelok. I have about 20+ pages that use it, and that also utilize some of the plugins available for it. It makes it cumbersome to republish after making changes.


I agree… I use Sitelok a great deal on my site and a slicker fix would be a huge help!

I am thinking a decent “find/replace” function for code entry sections of the app would allow us to comment out the sections of PHP code that cause the issue in preview mode. Might that work?

1 Like

@dan I really wish there were a better fix to the Sitelok problem. As written at the page you link us to:

Our suggested workaround would be to build the site in RapidWeaver and then add SiteLok at the very end once you’ve finished the it.

This suggestion works well if a person makes a website then goes on to the next project. But with most of the websites I develop, and probably others, this isn’t the reality we face. There’s ongoing tinkering and editing. Being able to preview changes in RW6 was incredibly useful. Now that is gone in RW7. It’s a big step backwards.


Loving Rapidweaver 7, fantastic release. However, the Sitelok issue is such a drag… The KB article is not really workable, as pages are constantly being updated and tweaked. Can anything be done about this?

Thanks for any feedback…

1 Like

I must agree with other comments made here. Sitelok is a fundamental part of my sports club site. RapidWeaver 7 is a great step forward, but I’m really hoping for a neater integration between Preview and Sitelok.


I didn’t realize there are so many Rapidweaver/Sitelok users - glad to know others find it as useful as I do. Wishing there was a better way to preview too.


Yes, I agree that the workaround is unviable. I have a very large site with hundreds of pages that all use Sitelok. The thought of having to move or comment-out code every time I want to preview something is painful. The old system in RW6 was much better, in which any such code was just ignored. I wish that this was an option, rather than the current RW 7 requirements.


Adrian from Vibralogix here. Having PHP processed in the RW7 preview is causing issues for many projects that use PHP and not just Sitelok and PowerGrid CSV. Anything but the simplest code is going to cause issues. Even a single line of PHP connecting to Mysql stops the preview. I don’t see any reason for the preview to handle PHP. Chances are that the PHP is going to need access to mysql or include files which are not available to the preview webserver. Even if they were its also likely that the PHP version used by RW and the server will not be the same and there will also be differences in the PHP modules installed. In my opinion the preview in RW7 should just be rendering the layout of the page and ignoring any PHP which in most cases will only work on the live server anyway.

At least having a setting to disable PHP in the preview would be a big help here. Without that option RW7 is not going to be usable for many projects that use PHP or databases.


Thanks for weighing in Adrian - hopefully @dan & team can implement a setting that will allow us to disable PHP in preview, should we need to.

1 Like

Just bumped into the same issue. Good thing is that, currently on all my projects I have only one php-snippet in Prefix and nothing else on a limited number of pages. I simply cut the snippet, review and paste it back in edit and prior to publishing. This works but is VERY cumbersome and bears a great risk of forgetting to put it back in. That would be horrible!!!

But, as some fellow weavers put it: Sitelok makes RapidWeaver more valuable and is my only choice for me to have a gated area in compliance with German dataprotection rules.
I would like to also vote for @dan to give that some thought for an upcoming release. Would be a great value while RW7 already is a huge step forward and loads of fun to work with!

Hi folks,

For those that don’t know me, I’m one of the developers on RapidWeaver.

First of all, we’ve heard your requests loud and clear and we’re trying to come up with a good solution for you here. I’m not sure what it is yet, but we’re working on it. It won’t make it into RapidWeaver 7.0.2, but I’d hope we’d have something figured out by the time 7.1 ships. I’ll update this thread when we know more details for certain.

However, I wanted to take a moment to point out that your code should never be throwing exceptions like this - exceptions, such as a failed require() or a missing MySQL extension should be handled gracefully by your code whether it’s running in RapidWeaver’s preview or on a live server somewhere. They should be caught and handled correctly rather than showing the default PHP error messages that make no sense to non-technical people.

Again, we’re actively working on this and we want to get the right solution for you. I’m sure we’ll do it :slight_smile:.
If you have any thoughts on what you’d like to see us do here (that might allow plugins like SiteLok to work correctly inside RapidWeaver’s Preview mode) then please don’t hesitate to drop @dan an email:



(Ping @vibralogix)


Sounds good Simon, thanks for looking into this!

1 Like