WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 13.07.2018 08:59:39

crnogorac081
Member

error when installing

I downloaded wbce portable and tiny newsletter, also replaced build_mail.inc.php , then I tried to add module to new page and got this error:

Fatal error: Uncaught Error: Call to a member function fetchRow() on null in C:\..\WBCEPortable_1.3\WBCEPortable_1.3\root\modules\tiny_newsletter\modify.php:86 Stack trace: #0 C:\..\WBCEPortable_1.3\WBCEPortable_1.3\root\admin\pages\modify.php(181): require() #1 {main} thrown in C:\..\WBCEPortable_1.3\WBCEPortable_1.3\root\modules\tiny_newsletter\modify.php on line 86

Offline

#2 13.07.2018 09:10:51

florian
Administrator

Re: error when installing

You are right, Tiny Newsletter does not work on WBCE Portable.
But even if these errors would not appear, you would not be able to test the sending of mails on a local installation... so I don't think it's useful to spend much effort on trying to get TNL working on WBCE Portable. Just setup a WBCE website on a real server and install TNL there, this will work flawlessly, I promise.


Code allein macht nicht glücklich. Jetzt spenden!

Offline

#3 13.07.2018 10:49:37

crnogorac081
Member

Re: error when installing

there is an error in install.php

$sql = 'CREATE TABLE `'.TABLE_PREFIX.'mod_'.$tablename.'_settings` ( '
	  . '`property`  VARCHAR(255) NOT NULL DEFAULT \'\','
	  . '`value` TEXT  NOT NULL, '	  
      . 'PRIMARY KEY (property)'
      . ' )';

varchar cant be primary key.. so table is not created on install

Offline

#4 13.07.2018 13:20:40

florian
Administrator

Re: error when installing

Thank you for the advice.
I wonder why this error does not appear (or at least does not cause any issues) if the module is installed on a webserver.


Code allein macht nicht glücklich. Jetzt spenden!

Offline

#5 13.07.2018 15:14:36

bernd
Developer

Re: error when installing

Just checked this sql statement on my playground server with MySQL 5.7.22.
It was performed without problems and the table was created.
Indeed, if it make sense to use a varchar field as primary key ... don't know.

Edit:
bit googeling around about this theme let me think: it's not forbidden to use varchar as primary key, but it's not the best practice

Here are some interesting facts for some data types usually used as primary keys:

Integer (INT)

Integers are the best choice for primary keys, because they are fast. On this data type you can define AUTO_INCREMENT, and computations are also performing fast.

String types (VARCHAR; CHAR)

I will devote a bit more text explaining why is not good to use string types as primary keys. String types are usually requiring more space and are much slower then integer types. It is much easier to compare two numbers, then two strings and this comparison of strings may introduce additional processing time.

If you define your primary key as VARCHAR then for every non UTF-8 character is represented by one byte, meaning that for string "abcdefghi" 9 bytes will be used. The same amount of bytes will be used in index table, and this requires much more space than for integer.

Defining string types as primary keys especially is not good in MyISAM engine where you can experience bad performance.

Source

Last edited by bernd (13.07.2018 15:25:31)


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Offline

#6 14.07.2018 12:05:26

crnogorac081
Member

Re: error when installing

running manually crate code show error with property index lenght..

Offline

Board footer

up