WBCE CMS – Way Better Content Editing.
Du bist nicht angemeldet.
Hello,
I try to use the Code2 module.
Installation was successful but when I select the module as a section on a page I get following message:
Fatal error: Call to a member function fetchRow() on a non-object in /srv/www/vhosts/domain.de/httpdocs/modules/code2/modify.php on line 41
This is the code in modify.php line 41:
// Get page content
$query = "SELECT `content`, `whatis`"
. " FROM `".TABLE_PREFIX."mod_code2`"
. " WHERE `section_id`= '".$section_id."'";
$get_content = $database->query($query);
$content = $get_content->fetchRow( MYSQL_ASSOC );
$whatis = (int)$content['whatis'];
$mode = ($whatis >= 10) ? (int)($whatis / 10) : 0;
$whatis = $whatis % 10;Does somebody has a solution for this?
Thanks in advance.
Offline
Hello and welcome,
that's strange, I never encountered any problems with code2 before. Can you provide more information about your enviroment, e.g.
- WBCE version
- PHP version
- mysql strict yes/no
- server type (apache or sth. else)
Did you download the newest module version (2.2.9) from GitHub?
Offline
it looks as if the section has not been added to the database and therefore the query fails when the backend tries to fetch it for rendering the edit area.
Is it sql-strict mode? Do you have access to the logs of the webserver and/or database?
For example apache's error log during the installation or during adding the page/section might point us to the root cause.
Offline
Thank you for the quick help.
I had a look in the database and mrbaseman is right, the Code2 modul is/was not loaded in the database.
As solution I copied the table from an old WebsiteBaker DB to the new one, and the module is now functioning.
I don't have access to the error log (I think).
And where can I see if the site is running in the sql-strict mode?
To get the other info I loaded the system information module.
This is some of the information I have:
WBCE Version: 1.1.6
PHP Version 5.4.20
5.5.46-MariaDB
But for now everything is running so far.
The WBCE looks very promising, thanks.
Offline
Kann auch anderswer die Installation von code2 unter wbce1.1.6 testen/wiederholen, und evtl. zusätzlich auch News -egal ob strict oder nich? Hatte auch Probleme mit fehlenden DB-Einträgen, wobei mir eine zweimalige Installation aus der Patsche half. Falls irgendwo der Wurm drin ist, wär's ja eine Gelegenheit, dies herauszufinden.
MfG. Evaki
Beitrag geändert von evaki (22.04.2016 12:20:30)
Please stick to english in this thread.
I don't give any general rules which language should be used in the forum, but at least in the single threads there should not be a mixup.
So the question was if there are any known problems installing code2 under WBCE 1.1.6. I just made a test with WBCE 1.1.6 under PHP 7.0.5.
code2 was installed without any problems. Creating a code2 section with the good old php "echo "hello world";" ran smoothly.
So it might be a mysql strict problem...? I don't know, I have no strict testing environment unfortunately.
Offline
sql strict or not would be displayed next to the sql version number in the backend, if I'm not mistaken, so robkiel probably would have seen that next to his maria-db version.
I had another look at add.php (which is called when the section should be added) and the installation routine in install.php. They both consist of one or two queries only, without any complicated stuff, properly quoted... I can't see anything that might result in the trouble described here, but if anyone else can spot a problem in the code or has logs which might point into the right direction this would be great
Offline