Module: ProcessPreview
#21
Posted 08 April 2012 - 07:40 AM
#22
Posted 08 April 2012 - 10:16 AM
1. When debug mode on, it breaks the admin. Notice shows up and page tree doesn't get loaded.
Notice: Undefined index: id in /.../site/modules/ProcessPreview/ProcessPreview.module on line 31
2. Still, when I open a page, edit something in the text, click "preview" it opens window, but the text change isn't there. When I close the window and hit "preview" again, it shows the updated text. Which means it only works every 2th time I hit "preview" when I change a text. In other words, everytime I change a text I have to open "preview" 2 times to see the change.
@somartist | modules created | support me, flattr my work flattr.com
#23
Posted 08 April 2012 - 10:42 AM
#24
Posted 09 April 2012 - 11:03 AM
I noticed another problem when submitting a front-end form and have this module installed I get this error:
Error Exception: You must assign a template to the page before setting custom field values. (in /Applications/XAMPP/xamppfiles/htdocs/pw-dev/wire/core/Page.php line 335)
#0 /Applications/XAMPP/xamppfiles/htdocs/pw-dev/site/modules/ProcessPreview/ProcessPreview.module(38): Page->setFieldValue('_form_id', '35cf3e112fd7061...')
#1 /Applications/XAMPP/xamppfiles/htdocs/pw-dev/wire/core/Wire.php(291): ProcessPreview->changeView(Object(HookEvent))
#2 /Applications/XAMPP/xamppfiles/htdocs/pw-dev/wire/core/Wire.php(229): Wire->runHooks('execute', Array)
#3 [internal function]: Wire->__call('execute', Array)
#4 /Applications/XAMPP/xamppfiles/htdocs/pw-dev/index.php(198): ProcessPageView->execute()
#5 {main}
@somartist | modules created | support me, flattr my work flattr.com
#25
Posted 09 April 2012 - 12:21 PM
And to issue#2: Which browser are you using and which system? Because I don't have this problem with Chrome on Mac OS X.
#26
Posted 09 April 2012 - 04:33 PM
if(isset($_POST['ProcessPreviewID'])) $this->addHook('ProcessPageView::execute', $this, 'changeView');
Now when your changeView function executes, you know there's little chance it's not getting involved when it shouldn't.
I also recommend modifying your changeView() function to sanitize the ID and validate that the page is editable, for security. Here's how I rewrote your function (though have not tested):
public function changeView(HookEvent $event) {
$page = $this->pages->get((int) $_POST['ProcessPreviewID']);
if(!$page->editable()) return;
foreach($_POST as $key => $value) {
if($page->fields->has($key)) $page->setFieldValue($key, $value);
}
$page->status = Page::statusOn;
$event->return = $page->render();
}
#27
Posted 09 April 2012 - 04:42 PM
And to issue#2: Which browser are you using and which system? Because I don't have this problem with Chrome on Mac OS X.
I'm also using Chrome 18.01... on Mac OS X 10.6.8
Edit: actually after trying again it stopped working. When clicking "preview" it does nothing.
This is from js console when clicking:
POST http://test.ch/about/ f.support.ajax.f.ajaxTransport.sendJqueryCore.js:18 f.extend.ajaxJqueryCore.js:18 (anonymous function)/processwire/page/edit/?id=1001:634 f.event.handleJqueryCore.js:17 f.event.add.i.handle.k
I have the latest and cleared cache. Same when using FF.
@somartist | modules created | support me, flattr my work flattr.com
#28
Posted 01 August 2012 - 12:08 PM
@somartist | modules created | support me, flattr my work flattr.com
#29
Posted 01 August 2012 - 12:26 PM
<?php
// include flourish lib
function flourish_loader( $class_name )
{
// Customize this to your root Flourish directory
$flourish_root = wire("config")->paths->root . '.libs/flourish/';
$file = $flourish_root . $class_name . '.php';
if (file_exists($file)) {
include $file;
}
}
spl_autoload_register( 'flourish_loader', true );
When the preview popup loads, it throws an Fatal Error, that the function is already defined. Somehow it renders or loads the page 2 times it seems. Not sure where this comes from, and if this could lead to problems elsewhere too.
However to avoid it one can write the flourish include like this (for reference)
<?php
if( !function_exists(flourish_loader)){
function flourish_loader( $class_name )
{
// Customize this to your root Flourish directory
$flourish_root = wire("config")->paths->root . '.libs/flourish/';
$file = $flourish_root . $class_name . '.php';
if (file_exists($file)) {
include $file;
}
}
}
spl_autoload_register( 'flourish_loader', true );Still my #2 still persists. When I change text on page and hit preview it doesn't show changes. Only after I close and click preview again it show the changed text.
@somartist | modules created | support me, flattr my work flattr.com
#30
Posted 13 August 2012 - 11:20 AM
If you're still working on this Nico, thanks for the effort and keep it up.
#31
Posted 16 August 2012 - 08:39 AM
#32
Posted 29 August 2012 - 02:00 PM
Again, it doesn't show any changes made when I use the preview button. Only when I open the preview a second time it shows the changes. I don't know what the problem is but it was always like this and doesn't let me use this module. I use OSX and Chrome and in FF it's the same.
@somartist | modules created | support me, flattr my work flattr.com
#33
Posted 26 September 2012 - 11:37 AM
@digitex: Have you tied it out yet? And does it break on your tests, too?
Sorry Nico, I wasn't ignoring you I just haven't been back to check threads in the forum for a while.
I haven't tested this yet. I will look into it this week and let you know if I have the same results as Soma.
#34
Posted 27 September 2012 - 11:11 AM
<h3>SPREAD AWARENESS!</h3><p><img class="[url=""]\"align_right\"[/url]" src="[url=""]%5C%22/pw/site/assets/files/1058/ce_sticker009.jpg%5C%22[/url]" alt="[url=""]\"\"[/url]" height="[url=""]\"300\"[/url]" width="[url=""]\"300\"[/url]"></p>Sort of like it's trying to escape the quote characters.
I'm using FF 14.0.1 and MacOS 10.6.5
#35
Posted 27 September 2012 - 01:02 PM
#36
Posted 28 December 2012 - 08:50 AM
#37
Posted 18 February 2013 - 12:22 PM
the preview seems not to show parts of the site template that are included with include_once. it's easy fixable with changing include_once to include. i just like to leave this as a sidenote, if someone got the same issues like me ( no header.inc/footer.inc
)
thank you for this nice plugin. it's realy something customers like to use and know from other systems.
#38
Posted 18 February 2013 - 03:04 PM
You're welcome. But I have no idea why "include_once" isn't working... Anyone?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













