Jump to content

Recommended Posts

Posted

Hi. I've recently moved a long standing site to a new server and now I get wireRenderFile is undefined on home page. So I checked on my localhost server and it is running fine on there. I'm using Markup Regions and the home page is just like all my pages using :

<div id="ajax-content" pw-replace>
	<?=wireRenderFile('_ajax-home.php', array('id' => $page->id))?>
</div>

I did a clean install of 3.0.255 and it runs ok. Replaced site files and imported my d.b as usual but gives red error screen -

The error I'm getting :

Hmm… Fatal Error: Uncaught Error: Call to undefined function wireRenderFile() in site/templates/home.php:3

#0 wire/core/TemplateFile.php (328): require()
#1 wire/core/Wire.php (413): TemplateFile->___render()
#2 wire/core/WireHooks.php (1018): Wire->_callMethod('___render', Array)
#3 wire/core/Wire.php (484): WireHooks->runHooks(Object(TemplateFile), 'render', Array)
#4 wire/modules/PageRender.module (547): Wire->__call('render', Array)
#5 wire/core/Page.php (3152): PageRender->render(Object(HomePage), Array)
#6 wire/core/Wire.php (416): Page->___renderPage(Array)
#7 wire/core/WireHooks.php (1018): Wire->_callMethod('___renderPage', Array)
#8 wire/core/Wire.php (484): WireHooks->runHooks(Object(HomePage), 'renderPage', Array)
#9 wire/core/Page.php (3097): Wire->__call('renderPage', Array)
#10 wire/core/Wire.php (413): Page->___render()
#11 wire/core/WireHooks.php (1018): Wire->_callMethod('___render', Array)
#12 wire/core/Wire.php (484): WireHooks->runHooks(Object(HomePage), 'render', Array)
#13 wire/modules/Process/ProcessPageView.module (193): Wire->__call('render', Array)
#14 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(HomePage), Object(PagesRequest))
#15 wire/core/Wire.php (416): ProcessPageView->___execute(true)
#16 wire/core/WireHooks.php (1018): Wire->_callMethod('___execute', Array)
#17 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array)
#18 index.php (55): Wire->__call('execute', Array)
#19 {main}
thrown (line 3 of site/templates/home.php)

I can login to admin on back end ok. Any attempt to view a page from admin gives the error above as they all use basic-page template with the same markup region. Like I said it all works fine on my localhost on 3.0.229

Any ideas? Thanks . 

Posted

Maybe some core files are missing on the server? It can happen that uploading a complete upload to a new server misses a file or something.

Posted

Thanks Soma. I've been away from this for a while! Has ProcessWire changed to use other than myISAM ? I just noticed during the install it sets innoDB by default. Would this matter if importing an old d.b saved as myISAM ? I'm getting some very strange problems on all my old projects now 

Posted

You posted this thuesday? Not sure what you mean been a while.

Not sure about the innoDB, but I don't think it matters unless for some index stuff?

Surely not related to your problem I guess. Even tho I don't know what problems you mean.

Posted
1 hour ago, Soma said:

You posted this thuesday? Not sure what you mean been a while.

Not sure about the innoDB, but I don't think it matters unless for some index stuff?

Surely not related to your problem I guess. Even tho I don't know what problems you mean.

Sorry for confusion Soma. I meant that post on Tuesday was my first for a long time. Everything has been running fine with my PW sites for years so I haven't been here and that's what I meant. But now I have this problem ..and others. But for now I am concentrating on solving this one I posted above on Tuesday. I'm going back to basics and trying to find out why it works on my localhost but not on the live server.  A clean install of the latest PW 3.0.255 blank site profile does work on the live server. During that I saw that the SQL storage engine is innoDB by default (good thing) but my sites were always myISAM but I think you're right - it shouldn't matter when importing a d.b.  The wireRenderFile undefined is strange because I can find the function in the core files on the live server so file is not missing. 

I will continue playing and report back any progress. Thank you Soma for your interest. 

Posted (edited)

I added the ProcessWire namespace as shown below. This seems to have fixed the wireRenderFile not found and the page now displays.  I do not know why it works without that on my localhost.

Perhaps it could be something to do with this forum post I found that gave me the idea to try adding the namespace?

https://processwire.com/talk/topic/11815-undefined-variable-pw-3-wirerenderfile-use-compiled-file/#comment-109884

<?php namespace ProcessWire; ?>
<div id="ajax-content" pw-replace>
	<?=wireRenderFile('_ajax-home.php', array('id' => $page->id))?>
</div>
Edited by rushy
added link

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   1 member

×
×
  • Create New...