botman / web-widget

MIT License
37 stars 68 forks source link

Urgent Issue - Conversation not working in web-widget #27

Closed sumoydas closed 4 years ago

sumoydas commented 5 years ago

Hi Marcel,

Today first time I have used Botman application. I have created a web-widget by using simple php file (without using any framework and without BotMan Studio). Initially I have implemented a basic example and it worked fine.

Then I try to implement the conversation logic by using the same files but its not working. when user submit a reply bot unable to read it and display it on the next phase.

In my project root there are only one folder "vendor" and 5 files composer.json. composer.lock, index.php, chat.php and chat.html

I'm using the PHP version: 7.1.11

Here I'm attaching my project folder botman-issue botman.zip

so you can check the issue and suggest me the actual solution for it.

sumoydas commented 5 years ago

Hello Marcel,

As per https://github.com/botman/botman/issues/778 this link I modified my composer.json file and added Doctrine Cache code in my chat.php

Now, when user submit his/her first text "hello" no reply has been displayed in the chatbot but the following error is shown in the console:

Warning: var_export does not handle circular references in E:\xampp\htdocs\botman\vendor\doctrine\cache\lib\Doctrine\Common\Cache\PhpFileCache.php on line 96
{"status":200,"messages":[{"type":"text","text":"Hello! What is your firstname?","attachment":null,"additionalParameters":[]}]}

And if I'm submitting any text again then chatbot does not show anything but generates the following error in console:

Fatal error: Uncaught Error: Call to undefined method BotMan\BotMan\BotMan::__set_state() in E:\xampp\htdocs\botman\cache\1c\5b636f6e766572736174696f6e2d353966353132663464333136393666346630313032376261376438303834363933353464363663352d353966353132663464333136393666346630313032376261376438303834363933353464363663355d5b315d.doctrinecache.php:9 Stack trace:

0 E:\xampp\htdocs\botman\vendor\doctrine\cache\lib\Doctrine\Common\Cache\PhpFileCache.php(112): include()

1 E:\xampp\htdocs\botman\vendor\doctrine\cache\lib\Doctrine\Common\Cache\PhpFileCache.php(63): Doctrine\Common\Cache\PhpFileCache->includeFileForId('[conversation-5...')

2 E:\xampp\htdocs\botman\vendor\doctrine\cache\lib\Doctrine\Common\Cache\CacheProvider.php(124): Doctrine\Common\Cache\PhpFileCache->doContains('[conversation-5...')

3 E:\xampp\htdocs\botman\vendor\botman\botman\src\Cache\DoctrineCache.php(31): Doctrine\Common\Cache\CacheProvider->contains('conversation-59...')

4 E:\xampp\htdocs\botman\vendor\botman\botman\src\Traits\HandlesConversations.php(173) in E:\xampp\htdocs\botman\cache\1c\5b636f6e766572736174696f6e2d353966353132663464333136393666346630313032376261376438303834363933353464363663352d353966353132663464333136393666346630313032376261376438303834363933353464363663355d5b315d.doctrinecache.php on line 9

Here I have attached my project code zip and the screenshot of the chatbot. botman.zip botman-issue1

Please find the attachments and tell me how can i solve this issues.

Thank You

mostar commented 4 years ago

Hi, Probably the php execution fail. Check you web server log fro the error message.