Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Error while adding new page
zmastez
New
This is what i got. Please help.
**Fatal Error in PagesSettingsController.NewPage();** Trying to get property of non-object The error occurred on or near: /opt/lampp/htdocs/thanglong/applications/basicpages/controllers/class.pagessettingscontroller.php 204: // Check if editing and if slug is same as one currently set in PageID. 205: $ValidPageID = $SQL 206: ->Select('p.UrlCode') 207: ->From('Page p') 208: ->Where('p.PageID', $Page->PageID) 209: ->Get()->FirstRow(); 210: // Make sure that the UrlCode is unique among pages. 211: $InvalidUrlCode = $SQL 212: ->Select('p.PageID') **Backtrace:** [/opt/lampp/htdocs/thanglong/applications/basicpages/controllers/class.pagessettingscontroller.php:208] PHP::Gdn_ErrorHandler(); [/opt/lampp/htdocs/thanglong/applications/basicpages/controllers/class.pagessettingscontroller.php:208] PagesSettingsController->NewPage(); [/opt/lampp/htdocs/thanglong/library/core/class.dispatcher.php:322] PHP::call_user_func_array(); [/opt/lampp/htdocs/thanglong/index.php:53] Gdn_Dispatcher->Dispatch(); Variables in local scope: [Page] NULL [FormValues] array ( 'TransientKey' => 'RPSXX0NUPW5P', 'hpt' => '', 'UrlCodeIsDefined' => '0', 'Name' => 'aaa', 'UrlCode' => 'aaa', 'Body' => 'aaaa', 'Format' => 'Html', 'SiteMenuLink' => '1', 'HidePageFromURL' => '1', 'Save' => 'Lưu', 'RawBody' => false, ) [SQL] array ( 'CaptureModifications' => false, 'ClassName' => 'Gdn_MySQLDriver', 'Database' => 'SECURITY', '_Order' => false, ) **Additional information for support personnel:** Application: Vanilla Application Version: 2.0.18.9 PHP Version: 5.3.8 Operating System: Linux Server Software: Apache Referer: http://xxxxxxxxxxxx/thanglong/pagessettings/newpage User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 Request Uri: /thanglong/pagessettings/newpage Controller: PagesSettingsController Method: NewPage
0
Comments
That means that in this code block :
The $Page object does not exist. You need to open that file, go to line 208. Above that line the $Page object is created. Show us 5 lines above and under that line where the page object is created
There was an error rendering this rich post.
Welcome to the community.
I just created a new page with Basic Pages 1.9 on a new, clean install of Vanilla 2.0.18.9 and the page was created successfully with no problems at all, but after looking at the code the way it is now, it's trying to retrieve an attribute from the $Page object, but it doesn't check if $Page was instantiated before query ($ValidPageID) is run at those lines of code. This query only needs to be run if a page is being edited.
This wasn't a known issue before because others and I have not run into this error during our testing, but one possible reason for the error is that your PHP could be configured to run code in a strict manner, so instead of the minor error getting ignored, it just shows the error right away.
I just uploaded Basic Pages 1.9.1 here: http://vanillaforums.org/addon/basicpages-application
Please let me know if you can create a new page with 1.9.1.
Add Pages to Vanilla with the Basic Pages app
This is how i solve the initial error:
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
But after that i got another eror when trying to edit or delete an existing page:
This is on Basic Pages 1.9.1 and Vanilla 2.0.18.10
I uploaded Basic Pages 1.9.2 with the fix for the error you posted. Thanks for reporting the bug, @zmastez!
Add Pages to Vanilla with the Basic Pages app
Confirm that this solve the issue. Thank you so much.