Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
Fix unserialization problem
Browse files Browse the repository at this point in the history
  • Loading branch information
blopa committed Mar 25, 2018
1 parent ddc7b57 commit 0c6163f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Magento2/app/code/Werules/Chatbot/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<message_options/>
<help_message>SOS!</help_message>
<enable_help_command_list>0</enable_help_command_list>
<commands_list> <!-- thanks to https://duzun.me/playground/serialize and https://stackoverflow.com/questions/14297926/structure-of-a-serialized-php-string -->
a:16:{s:18:"_1510428167773_773";a:4:{s:10:"command_id";s:1:"2";s:14:"enable_command";s:1:"1";s:12:"command_code";s:6:"Search";s:18:"command_alias_list";s:0:"";}s:18:"_1510428168781_781";a:4:{s:10:"command_id";s:1:"3";s:14:"enable_command";s:1:"1";s:12:"command_code";s:5:"Login";s:18:"command_alias_list";s:0:"";}s:17:"_1510428170069_69";a:4:{s:10:"command_id";s:1:"4";s:14:"enable_command";s:1:"1";s:12:"command_code";s:11:"List Orders";s:18:"command_alias_list";s:0:"";}s:18:"_1510428170781_781";a:4:{s:10:"command_id";s:1:"5";s:14:"enable_command";s:1:"1";s:12:"command_code";s:7:"Reorder";s:18:"command_alias_list";s:0:"";}s:18:"_1510428171332_332";a:4:{s:10:"command_id";s:1:"6";s:14:"enable_command";s:1:"1";s:12:"command_code";s:11:"Add to Cart";s:18:"command_alias_list";s:0:"";}s:18:"_1510428171828_828";a:4:{s:10:"command_id";s:1:"7";s:14:"enable_command";s:1:"1";s:12:"command_code";s:8:"Checkout";s:18:"command_alias_list";s:0:"";}s:18:"_1510428172317_317";a:4:{s:10:"command_id";s:1:"8";s:14:"enable_command";s:1:"1";s:12:"command_code";s:10:"Clear Cart";s:18:"command_alias_list";s:0:"";}s:18:"_1510428172909_909";a:4:{s:10:"command_id";s:1:"9";s:14:"enable_command";s:1:"1";s:12:"command_code";s:11:"Track Order";s:18:"command_alias_list";s:0:"";}s:18:"_1510428173452_452";a:4:{s:10:"command_id";s:2:"10";s:14:"enable_command";s:1:"1";s:12:"command_code";s:7:"Support";s:18:"command_alias_list";s:0:"";}s:17:"_1510428174012_12";a:4:{s:10:"command_id";s:2:"11";s:14:"enable_command";s:1:"1";s:12:"command_code";s:10:"Send Email";s:18:"command_alias_list";s:0:"";}s:18:"_1510428174525_525";a:4:{s:10:"command_id";s:2:"12";s:14:"enable_command";s:1:"1";s:12:"command_code";s:6:"Cancel";s:18:"command_alias_list";s:5:"Abort";}s:18:"_1510428175116_116";a:4:{s:10:"command_id";s:2:"13";s:14:"enable_command";s:1:"1";s:12:"command_code";s:4:"Help";s:18:"command_alias_list";s:0:"";}s:18:"_1510428176398_398";a:4:{s:10:"command_id";s:2:"14";s:14:"enable_command";s:1:"1";s:12:"command_code";s:5:"About";s:18:"command_alias_list";s:0:"";}s:18:"_1510428176911_911";a:4:{s:10:"command_id";s:2:"15";s:14:"enable_command";s:1:"1";s:12:"command_code";s:6:"Logout";s:18:"command_alias_list";s:0:"";}s:18:"_1510428177356_356";a:4:{s:10:"command_id";s:2:"16";s:14:"enable_command";s:1:"1";s:12:"command_code";s:8:"Register";s:18:"command_alias_list";s:0:"";}s:18:"_1510428242102_102";a:4:{s:10:"command_id";s:1:"1";s:14:"enable_command";s:1:"1";s:12:"command_code";s:15:"List Categories";s:18:"command_alias_list";s:0:"";}}
</commands_list>
<!--<commands_list> &lt;!&ndash; thanks to https://duzun.me/playground/serialize and https://stackoverflow.com/questions/14297926/structure-of-a-serialized-php-string &ndash;&gt;-->
<!--a:16:{s:18:"_1510428167773_773";a:4:{s:10:"command_id";s:1:"2";s:14:"enable_command";s:1:"1";s:12:"command_code";s:6:"Search";s:18:"command_alias_list";s:0:"";}s:18:"_1510428168781_781";a:4:{s:10:"command_id";s:1:"3";s:14:"enable_command";s:1:"1";s:12:"command_code";s:5:"Login";s:18:"command_alias_list";s:0:"";}s:17:"_1510428170069_69";a:4:{s:10:"command_id";s:1:"4";s:14:"enable_command";s:1:"1";s:12:"command_code";s:11:"List Orders";s:18:"command_alias_list";s:0:"";}s:18:"_1510428170781_781";a:4:{s:10:"command_id";s:1:"5";s:14:"enable_command";s:1:"1";s:12:"command_code";s:7:"Reorder";s:18:"command_alias_list";s:0:"";}s:18:"_1510428171332_332";a:4:{s:10:"command_id";s:1:"6";s:14:"enable_command";s:1:"1";s:12:"command_code";s:11:"Add to Cart";s:18:"command_alias_list";s:0:"";}s:18:"_1510428171828_828";a:4:{s:10:"command_id";s:1:"7";s:14:"enable_command";s:1:"1";s:12:"command_code";s:8:"Checkout";s:18:"command_alias_list";s:0:"";}s:18:"_1510428172317_317";a:4:{s:10:"command_id";s:1:"8";s:14:"enable_command";s:1:"1";s:12:"command_code";s:10:"Clear Cart";s:18:"command_alias_list";s:0:"";}s:18:"_1510428172909_909";a:4:{s:10:"command_id";s:1:"9";s:14:"enable_command";s:1:"1";s:12:"command_code";s:11:"Track Order";s:18:"command_alias_list";s:0:"";}s:18:"_1510428173452_452";a:4:{s:10:"command_id";s:2:"10";s:14:"enable_command";s:1:"1";s:12:"command_code";s:7:"Support";s:18:"command_alias_list";s:0:"";}s:17:"_1510428174012_12";a:4:{s:10:"command_id";s:2:"11";s:14:"enable_command";s:1:"1";s:12:"command_code";s:10:"Send Email";s:18:"command_alias_list";s:0:"";}s:18:"_1510428174525_525";a:4:{s:10:"command_id";s:2:"12";s:14:"enable_command";s:1:"1";s:12:"command_code";s:6:"Cancel";s:18:"command_alias_list";s:5:"Abort";}s:18:"_1510428175116_116";a:4:{s:10:"command_id";s:2:"13";s:14:"enable_command";s:1:"1";s:12:"command_code";s:4:"Help";s:18:"command_alias_list";s:0:"";}s:18:"_1510428176398_398";a:4:{s:10:"command_id";s:2:"14";s:14:"enable_command";s:1:"1";s:12:"command_code";s:5:"About";s:18:"command_alias_list";s:0:"";}s:18:"_1510428176911_911";a:4:{s:10:"command_id";s:2:"15";s:14:"enable_command";s:1:"1";s:12:"command_code";s:6:"Logout";s:18:"command_alias_list";s:0:"";}s:18:"_1510428177356_356";a:4:{s:10:"command_id";s:2:"16";s:14:"enable_command";s:1:"1";s:12:"command_code";s:8:"Register";s:18:"command_alias_list";s:0:"";}s:18:"_1510428242102_102";a:4:{s:10:"command_id";s:1:"1";s:14:"enable_command";s:1:"1";s:12:"command_code";s:15:"List Categories";s:18:"command_alias_list";s:0:"";}}-->
<!--</commands_list>-->
<enable_default_replies>0</enable_default_replies>
<default_replies/>
<enable_nlp_replies/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,31 @@
updateCustomKeyUrl(custom_key.value);

var scheduled_clear = document.getElementById('werules_chatbot_danger_general_clear_message_pending');
if (scheduled_clear)
{
if (scheduled_clear.value === '1')
{
if (scheduled_clear) {
if (scheduled_clear.value === '1') {
var schedule_message = document.getElementById('werules_scheduled_clearing');
if (schedule_message)
document.getElementById('werules_scheduled_clearing').style.display = 'block';
}
}

function updateCustomKeyUrl(custom_key)
{
function updateCustomKeyUrl(custom_key) {
var messenger_url = document.getElementById('werules_messenger_url');
var telegram_url = document.getElementById('werules_telegram_url');
var store_url = '<?php echo $baseUrl; ?>';
// messenger_url.href = store_url + 'chatbot/webhook/endpoint/api/messenger/key/' + custom_key;
messenger_url.href = 'https://werules.github.io/chatbot/?key=' + custom_key;
telegram_url.href = store_url + 'chatbot/webhook/endpoint/api/messenger/key/' + custom_key;
messenger_url.href = 'https://werules.github.io/chatbot/?key=' + custom_key + '&base_url=' + store_url;
// telegram_url.href = store_url + 'chatbot/webhook/endpoint/api/messenger/key/' + custom_key; // TODO
}

function generateCustomKey()
{
function generateCustomKey() {
var key_input = document.getElementById('werules_chatbot_general_general_custom_key');
var custom_key = getRandomCustomKey(Math.floor(Math.random() * 4));
key_input.value = custom_key;
// updateCustomKeyUrl(custom_key);
}

function getRandomCustomKey(qty)
{
function getRandomCustomKey(qty) {
var key = '';
for (var i = 0; i <= qty; i++)
key += Math.random().toString(36).substring(2, 15);
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ Go to **System > General Settings > Chatbot Settings**

## Release Notes
### Magento2
- **v1.0.7:**
- Fix unserialization problem [#146](https://github.com/blopa/Magento-Chatbot/issues/146) (thanks [xmav](https://github.com/xmav))
- **v1.0.6:**
- Update license
- Fix issue [#142](https://github.com/blopa/Magento-Chatbot/issues/142)
Expand Down
Binary file modified screenshots/m2/messenger_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0c6163f

Please sign in to comment.