I got this error while importing pgn

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

I got this error while importing pgn

Post by uyasar » Tue Feb 21, 2017 7:42 pm

Hello,
I ve got this error while importing pgn:
Fatal error: Uncaught exception 'Exception' with message 'Fen: 8/pp1q1p1Q/n2P1kp1/2p1R1N1/5P2/P1P5/6PP/6K1 b - - 0 10 color: black notation: Qh8 Rank: File: 0, ' in /home/mobilderslik/eders.org/wp-content/plugins/dhtml_chess/api/php/parser/FenParser0x88.php:1327 Stack trace: #0 /home/mobilderslik/eders.org/wp-content/plugins/dhtml_chess/api/php/parser/FenParser0x88.php(1169): FenParser0x88->getFromAndToByNotation('Qh8+') #1 /home/mobilderslik/eders.org/wp-content/plugins/dhtml_chess/api/php/parser/GameParser.php(50): FenParser0x88->getParsed(Array) #2 /home/mobilderslik/eders.org/wp-content/plugins/dhtml_chess/api/php/parser/GameParser.php(34): GameParser->parseAMove(Array) #3 /home/mobilderslik/eders.org/wp-content/plugins/dhtml_chess/api/php/parser/GameParser.php(57): GameParser->parseMoves(Array) #4 /home/mobilderslik/eders.org/wp-content/plugins/dhtml_chess/api/php/parser/GameParser.php(47): GameParser->parseVariations(Array) #5 /home/mobilderslik/eders.org/wp-content/plugins/dhtml_chess/api/php/parser/GameParser.php( in /home/mobilderslik/eders.org/wp-content/plugins/dhtml_chess/api/php/parser/FenParser0x88.php on line 1327

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

Re: I got this error while importing pgn

Post by alf » Tue Feb 21, 2017 8:40 pm

Send me the pgn(you have my email) and I will take a look at it. It's a problem parsing one of the games.

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

Re: I got this error while importing pgn

Post by uyasar » Wed Feb 22, 2017 2:43 pm

It is art_attack pgn from the demo folder

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

Re: I got this error while importing pgn

Post by alf » Wed Feb 22, 2017 2:49 pm

Ah ok :) I will fix that tonight.

Some pgns are buggy. I will modify the code for the pgn to JSON parser so that it gracefully ignores games it can't understand. I will of course also try to fix the parser if there's a bug in it.

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

Re: I got this error while importing pgn

Post by alf » Wed Feb 22, 2017 5:23 pm

The plugin has been updated with a temporary fix for this problem.

It occurred because of NULL moves in the pgn, i.e. things like:

9... -- 10. Re5 (notice the --)

I have not yet implemented support for NULL moves, but I have added it to my Trello boards of upcoming tasks.

The temporary bugfix is to ignore games the parser can't understand, i.e it imports the rest of the games without any errors. It's a better user experience than throwing a FATAL error.

Idochesswork
Posts: 57
Joined: Wed Mar 08, 2017 8:17 am

Re: I got this error while importing pgn

Post by Idochesswork » Thu Mar 16, 2017 10:30 am

Hi alf,

Whenever I import pgn, it missed the first game.
Then I try to remove the database by swiping it, and go to Archived Database to delete it and reload another time (same file), and now, the game in database are enough. Is this a bug, or just me have that problem?

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

Re: I got this error while importing pgn

Post by alf » Thu Mar 16, 2017 11:03 am

If you're missing a game, there could be a problem with your pgn(or the DHTML Chess parser).

If you post the first few games of the pgn here, I will try it out with the parser to see if there are any problems.

When you import games into DHTML Chess, there is a parser which analyses the game and stores the game in the database in a computer-readable format(JSON). There has been some issues in the past where the parser could not understand the PGN. I have fixed most of these issues, but there may be other problems.

Idochesswork
Posts: 57
Joined: Wed Mar 08, 2017 8:17 am

Re: I got this error while importing pgn

Post by Idochesswork » Fri Mar 17, 2017 8:03 am

I tried once again, to see if the problem would occur or not. And it's just the same. The game editor just show 29, instead of 30 exercises, and it missed the first one.

http://pastebin.com/ZuQxhjfh

It's not a critical problem. However, I think that in our Game Editor, you can add a function to rearrange the order of database's game, so that we can manually enter the game, the position and then rearrange it to the order that fit best. I.e: "+" button to move a selected game up, and "-" button to move it down.

Thank you Alf,
Warm regards,

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

Re: I got this error while importing pgn

Post by alf » Fri Mar 17, 2017 6:56 pm

Thanks for providing a link to the pgn.

I have tested the pgn now, and cannot find any problems with it. I get 30 games when I import the pgn. I'm also getting 30 games parsed when I test it directly with the PGN to JSON PHP parser.

Idochesswork
Posts: 57
Joined: Wed Mar 08, 2017 8:17 am

Re: I got this error while importing pgn

Post by Idochesswork » Mon Mar 20, 2017 2:23 pm

Hi alf,

Thank you for taking a look. Maybe it's because of my web server. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests