Forum

Thread tagged as: Addons, Add-on-development, Comments

here is the debug on the same page, prior to a form submission:

Time    Δ   Debug Message
0.0233  0   [1] SELECT * FROM perch2_pages WHERE pagePath='/reveiws.php' LIMIT 1
0.0267  0.0033  Using template: /templates/pages/attributes/default.html
0.0268  0.0001  Using sub-template: /templates/pages/attributes/seo.html
0.0271  0.0003  [7] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
0.0275  0.0004  [1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/reveiws.php' LIMIT 1
0.0276  0.0001  [1] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-009', '000') ORDER BY pageTreePosition DESC
0.0278  0.0002  [7] Using template: /templates/navigation/item.html
0.0296  0.0018  [8] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/reveiws.php' OR regionPage='*' ORDER BY regionPage DESC
0.03    0.0004  [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Social Media' AND (regionPage='/reveiws.php' OR regionPage='*')
0.0303  0.0003  [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=92 AND idx.itemRev=8)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
0.0404  0.0101  [1] Using template: /templates/content/phone.html
0.0408  0.0004  [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Reservation Links' AND (regionPage='/reveiws.php' OR regionPage='*')
0.0413  0.0005  [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=103 AND idx.itemRev=10)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval ORDER BY sortval ASC
0.0436  0.0023  [1] Using template: /templates/content/reservation_links.html
0.0451  0.0015  [17] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
0.0471  0.002   [nil] SELECT * FROM perch2_comments WHERE 1=1 AND parentID='general' AND commentStatus='LIVE' ORDER BY commentDateTime ASC
0.0477  0.0006  [] Using template: /templates/comments/comment.html
0.051   0.0034  

Array
(
    [type] => 8
    [message] => Undefined index: id
    [file] => /Volumes/OWC_Work_files/work/PHP-Sites/dev.diamondtransportation.com/perch/core/lib/PerchTemplatedForm.class.php
    [line] => 427
)
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't really follow what's happening, but it looks like there's no attempt to insert the comment. Did it work before you added the rating fields?

No, even without the ratings it still doesn't get inserted into the db table. When I looked at the db using phpMyAdmin the following errors popped up when trying to view the comments table

Notice in ./libraries/tbl_info.inc.php#99
 Array to string conversion

Backtrace

./tbl_structure.php#166: require_once(./libraries/tbl_info.inc.php)
Notice in ./libraries/tbl_info.inc.php#99
 Array to string conversion

Backtrace

./libraries/Menu.class.php#221: include(./libraries/tbl_info.inc.php)
./libraries/Menu.class.php#85: PMA_Menu->_getBreadcrumbs()
./libraries/Response.class.php#308: PMA_Menu->getHash()
./libraries/Response.class.php#388: PMA_Response->_ajaxResponse()
PMA_Response::response()
Notice in ./libraries/tbl_info.inc.php#99
 Array to string conversion

Backtrace

./libraries/Menu.class.php#221: include(./libraries/tbl_info.inc.php)
./libraries/Menu.class.php#72: PMA_Menu->_getBreadcrumbs()
./libraries/Response.class.php#315: PMA_Menu->getDisplay()
./libraries/Response.class.php#388: PMA_Response->_ajaxResponse()
PMA_Response::response()

And when viewing the comments_votes table these errors popped up

Notice in ./libraries/tbl_info.inc.php#99
 Array to string conversion

Backtrace

./tbl_structure.php#166: require_once(./libraries/tbl_info.inc.php)
Notice in ./libraries/tbl_info.inc.php#99
 Array to string conversion

Backtrace

./libraries/Menu.class.php#221: include(./libraries/tbl_info.inc.php)
./libraries/Menu.class.php#85: PMA_Menu->_getBreadcrumbs()
./libraries/Response.class.php#308: PMA_Menu->getHash()
./libraries/Response.class.php#388: PMA_Response->_ajaxResponse()
PMA_Response::response()
Notice in ./libraries/tbl_info.inc.php#99
 Array to string conversion

Backtrace

./libraries/Menu.class.php#221: include(./libraries/tbl_info.inc.php)
./libraries/Menu.class.php#72: PMA_Menu->_getBreadcrumbs()
./libraries/Response.class.php#315: PMA_Menu->getDisplay()
./libraries/Response.class.php#388: PMA_Response->_ajaxResponse()
PMA_Response::response()

None of the other tables show errors when being viewed. I hope this helps. Thank you.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That doesn't look good. Can you try dropping those tables and letting the app reinstall them?

I tried dropping the tables and letting the app reinstall them and still got the same errors on those 2 tables. In addition, prior to reinstalling the app and recreating the tables, I replaced the "core" directory just in case something was missing from there as well. Still got those errors.

BTW, I am using the forms app on another page and it too, will not submit.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have any server side redirects in place?

Redirects? No, I don't believe so.

I also tried installing the comments_app on another perch site and the same errors are showing on that site database as well. Just on the 2 comments tables. I installed the forms_app on both sites and there are no errors on the tables installed for the forms_app on either site.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you included both in your config/apps.php file?

Yes, I have. Here is what my config/apps.php file looks like right now

<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_comments',
        'perch_forms',
    );
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. So it sounds like there's some underlying problem with forms in your site.

Is this all on one server, or do you have different development and production servers?

This is all running on my mac with Mamp, apache and MySQL.

Creating the initial database works just fine. Creating templates/pages and everything else works perfectly. The only issue is the forms. Both sites are on the same server set up. Each uses the staging domain of dev.domainname.com and runs under it's own port number in Mamp.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do any forms work in the control panel? Can you edit content?

I can edit all content, yes. I can create new pages, populate them and edit any content that's already on the sites. The 2nd site is brand new, and I'm building templates and adding regions and it's working perfectly.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have any sites where forms are working for you?

Actually, no these are the first 2 sites I've used perch forms. I only have one other site on perch right now and it's not using forms.