Plugin could not be activated because it triggered a fatal error.

This is the place to post bug reports for the DHTML Chess plugin for WordPress
Post Reply
uyasar
Posts: 27
Joined: Tue Feb 14, 2017 2:01 pm

Plugin could not be activated because it triggered a fatal error.

Post by uyasar » Tue Feb 14, 2017 3:19 pm

Hello, I do not know if this is a bug or not but when I try to activate the plugin I get this message:

Plugin could not be activated because it triggered a fatal error.

Fatal error: Uncaught exception 'DhtmlChessPgnNotFoundException' with message 'Unable to locate pgn' in /home/mobilderslik/eders.org/wp-content/plugins/dhtml-chess-wordpress/api/php/wordpress/DhtmlChessPgn.php:72 Stack trace: #0 /home/mobilderslik/eders.org/wp-content/plugins/dhtml-chess-wordpress/api/php/wordpress/DhtmlChessPgnUtil.php(58): DhtmlChessPgn::instanceById(0) #1 /home/mobilderslik/eders.org/wp-content/plugins/dhtml-chess-wordpress/api/php/wordpress/DhtmlChessImportPgn.php(59): DhtmlChessPgnUtil->create('Great Games') #2 /home/mobilderslik/eders.org/wp-content/plugins/dhtml-chess-wordpress/api/php/wordpress/DhtmlChessInstaller.php(74): DhtmlChessImportPgn->createFromPgnString('Great Games', '[Event "4th mat...') #3 /home/mobilderslik/eders.org/wp-content/plugins/dhtml-chess-wordpress/api/php/wordpress/DhtmlChessInstaller.php(68): DhtmlChessInstaller->importDefaultPgn() #4 /home/mobilderslik/eders.org/wp-content/plugins/dhtml-chess-wordpress/includes/class-dhtml_chess-activator.php(37): DhtmlChessInstaller->ins in /home/mobilderslik/eders.org/wp-content/plugins/dhtml-chess-wordpress/api/php/wordpress/DhtmlChessPgn.php on line 72

alf
Site Admin
Posts: 111
Joined: Sat Feb 18, 2017 11:02 pm

Re: Plugin could not be activated because it triggered a fatal error.

Post by alf » Tue Feb 14, 2017 3:44 pm

Thanks for providing the stack trace. That's really helpful, and I appreciate that :)

I have a working version my self, so I haven't discovered this bug yet. Do you know which WordPress version you are using?

From the stack trace, it seems that the databases aren't created properly

The bug occurs inside the file

dhtml_chess/api/php/wordpress/DhtmlChessInstaller.php

where it created the databases and puts some default games and databases into it. It fails when it tries to put these games into the database.

What you can try to do is to open that file

DhtmlChessInstaller.php

in a code editor or Notepad and change line 68 from

$this->importDefaultPgn();

to

// $this->importDefaultPgn();

and see if you're able to activate the plugin.

I will look more into this tonight, do some debugging and hopefully post an updated zip file here.

uyasar
Posts: 27
Joined: Tue Feb 14, 2017 2:01 pm

Re: Plugin could not be activated because it triggered a fatal error.

Post by uyasar » Tue Feb 14, 2017 5:04 pm

my wordpress version is 4.7.2. And yes, it worked, i was able to activate the plugin but:
Image

alf
Site Admin
Posts: 111
Joined: Sat Feb 18, 2017 11:02 pm

Re: Plugin could not be activated because it triggered a fatal error.

Post by alf » Tue Feb 14, 2017 6:14 pm

I have managed to reproduce this problem on my Hostgator site. It did work locally, so I didn't catch that error earlier. It's not creating all the database tables during install.

I have uploaded a new dhtml-chess-wordpress.zip file now which takes care of some of the problem. Just download it and overwrite your existing wp-content/plugins/dhtml_chess folder

But there's still some database issues to solve. I will look more at them in a while.

If you have access to MySql, you may try to create the tables manually:

create table dhtml_chess_pgn(id int auto_increment not null primary key,pgn_name varchar(255),tmp varchar(255),archived char(1) default '0', hidden char(1) default '0' ,updated timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
create table dhtml_chess_game(id int auto_increment not null primary key,pgn_id int,sort int,dhtml_chess_id int,game mediumtext, updated timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
create table dhtml_chess_cache(id int auto_increment not null primary key,cache_key varchar(255),updated timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,cache_val mediumtext);;
create table dhtml_chess_game_draft(id int auto_increment not null primary key,title varchar(1024), game mediumtext, updated timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);;
create index wp_index_dhtml_chess_pgn_arc on dhtml_chess_pgn(archived);
create index wp_index_dhtml_chess_game_did on dhtml_chess_game(dhtml_chess_id);
create index wp_index_dhtml_chess_game_pgn on dhtml_chess_game(pgn_id);
create index wp_index_dhtml_chess_cache_key on dhtml_chess_cache(cache_key);

alf
Site Admin
Posts: 111
Joined: Sat Feb 18, 2017 11:02 pm

Re: Plugin could not be activated because it triggered a fatal error.

Post by alf » Tue Feb 14, 2017 9:53 pm

I think this issue has been resolved now in the latest zip

http://www.dhtml-chess.com/api/zip/dhtm ... dpress.zip

Follow the same procedure

1) delete your existing wp-content/plugins/dhtml_chess folder
2) unzip the zip file and copy the dhtml_chess folder from the zip into wp-content/plugins
3) From the plugins page, select activate for the plugin(if it's already activated, select deactivate followed by activate).

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests