You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The call to $child->render('offer_matrix'); is not resulting in rendering of a field, but rather a page - it's looking for "offer_matrix" in site/templates/, instead of "offer_matrix.php" in site/templates/fields/.
This works as expected in a regular PW template, but it doesn't when run inside Tracy Debugger console (and perhaps also when PW is bootstrapped - but I did not test that at this point).
$myOffer = 11404;
$myOfferPage = $pages->get($myOffer);
// using absolute path doesn't work:
$str = wireRenderFile("/home/domainname/www/dev.mysite/site/templates/offer-index-dev.php", array("offer_index_page_id" => $myOffer));
// using relative path doesn't work either: (default is site/templates/ - according to docs)
$str = wireRenderFile("offer-index-dev.php", array("offer_index_page_id" => $myOffer));
// using relative path without .php suffix doesn't work either: (according to docs .php suffix can be omitted)
$str = wireRenderFile("offer-index-dev", array("offer_index_page_id" => $myOffer));
// $str is then used to generate a PDF and save it to a page - but the error appears above this
// fatal error msg: * Exception: Invalid output file location or specified file does not exist. on line: 518 in /home/mydomain/www/dev.mysite/wire/modules/PageRender.module
inside offer-index-dev.php, the relevant place where the error is triggered:
foreach($offer_index->children as $child) {
echo $child->render('offer_matrix'); // that's where PW gives up and terminates
// echo $child->render('/home/mydomain/www/dev.mysite/site/templates/fields/offer_matrix.php', $vars = ["pid" => $child->id]); // I've tried again with abs. path here
// echo $child->render('/home/mydomain/www/dev.mysite/site/templates/fields/offer_matrix'); // ... and abs. path w/o .php suffix here
}
Expected behavior
I would expect that PW renders the field templates like it does when run from inside a "normal" PW template. Especially in the case where I use the absolute path, incl. file-suffix.
Actual behavior
Exception: Invalid output file location or specified file does not exist. on line: 518 in /home/mydomain/www/dev.mysite/wire/modules/PageRender.module
The call to $child->render('offer_matrix'); is not resulting in rendering of a field, but rather a page - it's looking for "offer_matrix" in site/templates/, instead of "offer_matrix.php" in site/templates/fields/.
@ryancramerdesign - even though this issue seems to be due to it trying to render the template, rather than the field, I wonder if this issue is also at least a bit related to #511
It would be great if you could also test that again while you are looking into this one because so many of us are using Tracy's Console panel for code testing and this is the one area where there seems to be problems.
Short description of the issue
The call to $child->render('offer_matrix'); is not resulting in rendering of a field, but rather a page - it's looking for "offer_matrix" in site/templates/, instead of "offer_matrix.php" in site/templates/fields/.
This works as expected in a regular PW template, but it doesn't when run inside Tracy Debugger console (and perhaps also when PW is bootstrapped - but I did not test that at this point).
inside offer-index-dev.php, the relevant place where the error is triggered:
Expected behavior
I would expect that PW renders the field templates like it does when run from inside a "normal" PW template. Especially in the case where I use the absolute path, incl. file-suffix.
Actual behavior
Exception: Invalid output file location or specified file does not exist. on line: 518 in /home/mydomain/www/dev.mysite/wire/modules/PageRender.module
The call to $child->render('offer_matrix'); is not resulting in rendering of a field, but rather a page - it's looking for "offer_matrix" in site/templates/, instead of "offer_matrix.php" in site/templates/fields/.
Steps to reproduce the issue
Setup/Environment
The text was updated successfully, but these errors were encountered: