Jump to content

"Unexpected Input" in latest build


Pete
 Share

Recommended Posts

I just downloaded the very latest build as I hadn't done in a while and I'm getting an error message when adding new pages - it says "Unexpected input".

I switched developer mode on and here's the full output:

TemplateFile: Unexpected input

#0 C:\xampp\htdocs\sc11\wire\modules\Process\ProcessPageAdd\ProcessPageAdd.module(80): ProcessPageAdd->processInput(Object(InputfieldForm))
#1 [internal function]: ProcessPageAdd->___execute()
#2 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array)
#3 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('execute', Array)
#4 C:\xampp\htdocs\sc11\wire\core\ProcessController.php(194): Wire->__call('execute', Array)
#5 C:\xampp\htdocs\sc11\wire\core\ProcessController.php(194): ProcessPageAdd->execute()
#6 [internal function]: ProcessController->___execute()
#7 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array)
#8 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('execute', Array)
#9 C:\xampp\htdocs\sc11\wire\core\admin.php(42): Wire->__call('execute', Array)
#10 C:\xampp\htdocs\sc11\wire\core\admin.php(42): ProcessController->execute()
#11 C:\xampp\htdocs\sc11\site\templates-admin\controller.php(13): require('C:\xampp\htdocs...')
#12 C:\xampp\htdocs\sc11\site\templates\admin.php(13): require('C:\xampp\htdocs...')
#13 C:\xampp\htdocs\sc11\wire\core\TemplateFile.php(88): require('C:\xampp\htdocs...')
#14 [internal function]: TemplateFile->___render()
#15 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array)
#16 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('render', Array)
#17 C:\xampp\htdocs\sc11\wire\modules\PageRender.module(194): Wire->__call('render', Array)
#18 C:\xampp\htdocs\sc11\wire\modules\PageRender.module(194): TemplateFile->render()
#19 [internal function]: PageRender->___renderPage(Object(HookEvent))
#20 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array)
#21 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('renderPage', Array)
#22 C:\xampp\htdocs\sc11\wire\core\Wire.php(289): Wire->__call('renderPage', Array)
#23 C:\xampp\htdocs\sc11\wire\core\Wire.php(289): PageRender->renderPage(Object(HookEvent))
#24 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('render', Array)
#25 C:\xampp\htdocs\sc11\wire\modules\Process\ProcessPageView.module(73): Wire->__call('render', Array)
#26 C:\xampp\htdocs\sc11\wire\modules\Process\ProcessPageView.module(73): Page->render()
#27 [internal function]: ProcessPageView->___execute()
#28 C:\xampp\htdocs\sc11\wire\core\Wire.php(267): call_user_func_array(Array, Array)
#29 C:\xampp\htdocs\sc11\wire\core\Wire.php(229): Wire->runHooks('execute', Array)
#30 C:\xampp\htdocs\sc11\index.php(170): Wire->__call('execute', Array)
#31 C:\xampp\htdocs\sc11\index.php(170): ProcessPageView->execute()
#32 {main}

Any ideas?

Link to comment
Share on other sites

Looking in the code, the only way you can receive that message is if something is POSTed to ProcessPageAdd that isn't from the ProcessPageAdd form. I went ahead and changed it to check a different way (just in case?), if you want to grab the latest commit, or just this file if you prefer:

https://github.com/ryancramerdesign/P21/blob/960742d2c91ec66e7d593926f59a0c9d6f2125a9/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module

Link to comment
Share on other sites

Do you have any other modules installed?

PW was checking for a POST with count($_POST), then it didn't see the expected 'submit_save' POST var and threw the message you received. I think this is the way the code has worked since 2.0. So I changed it to just look for 'submit_save' instead (no reason to do both I suppose).

My best guess is that $_POST was populated with something for some reason, even though there was no POST. Would be interesting to see a print_r($_POST) to see what was in it. The only thing I can guess is perhaps something from another module?

Link to comment
Share on other sites

Cheers ryan, bizarrely it was still doing it this morning before using the updated code so my test server on my laptop had been restarted.

Once I updated the code to the version you updated the issue went away.

Very strange, but fixed now :)

Link to comment
Share on other sites

Try running this script on the same server and browser and let me know what you get:

<pre>
<?php
if(count($_POST)) print_r($_POST); 
    else echo "POST is empty";

Just want to make sure you don't have some spyware or something behind the scenes trying to experiment with POST vars.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...