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

Commit 63684fa

Browse files
authored
Merge pull request #149 from blopa/hotfix/unserialization_glitch
Hotfix/unserialization glitch
2 parents ddc7b57 + 5fe321b commit 63684fa

File tree

7 files changed

+18
-21
lines changed

7 files changed

+18
-21
lines changed

Magento2/app/code/Werules/Chatbot/Setup/UpgradeData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function upgrade(
3434
ModuleContextInterface $context
3535
) {
3636
$setup->startSetup();
37-
if (version_compare($context->getVersion(), "1.0.6", "<")) {
38-
//Your upgrade script
37+
if (version_compare($context->getVersion(), "1.0.7", "<")) {
38+
//Your upgrade script
3939
}
4040
$setup->endSetup();
4141
}

Magento2/app/code/Werules/Chatbot/etc/adminhtml/system.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<group id="general" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="10" translate="label comment tooltip">
1212
<label>General Settings</label>
1313
<comment><![CDATA[
14-
<h3>Magento Chatbot v1.0.6</h3>
14+
<h3>Magento Chatbot v1.0.7</h3>
1515
<p>To use this module you'll have to use SSL in your store.</p>
1616
]]></comment>
1717
<field id="enable" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="1" translate="label comment tooltip" type="select">
@@ -67,7 +67,7 @@
6767
<group id="general" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="10" translate="label comment tooltip">
6868
<label>Messenger Settings</label>
6969
<comment><![CDATA[
70-
<h3>Magento Chatbot v1.0.6</h3>
70+
<h3>Magento Chatbot v1.0.7</h3>
7171
<p>To use this module you'll have to use SSL in your store.</p>
7272
]]></comment>
7373
<field id="enable" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="1" translate="label comment tooltip" type="select">
@@ -240,7 +240,7 @@
240240
<group id="general" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="10" translate="label comment tooltip">
241241
<label>Danger Zone</label>
242242
<comment><![CDATA[
243-
<h3>Magento Chatbot v1.0.6</h3>
243+
<h3>Magento Chatbot v1.0.7</h3>
244244
<p>To use this module you'll have to use SSL in your store.</p>
245245
<p style='color: red;'><b>You should only change settings here if you know what you're doing.</b></p>
246246
<div class='message-system-inner' id='werules_scheduled_clearing' style='display: none; border-width: 0.1rem; padding: 0 1.5rem 0 3rem;'>

Magento2/app/code/Werules/Chatbot/etc/config.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<message_options/>
3030
<help_message>SOS!</help_message>
3131
<enable_help_command_list>0</enable_help_command_list>
32-
<commands_list> <!-- thanks to https://duzun.me/playground/serialize and https://stackoverflow.com/questions/14297926/structure-of-a-serialized-php-string -->
33-
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:"";}}
34-
</commands_list>
32+
<!--<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;-->
33+
<!--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:"";}}-->
34+
<!--</commands_list>-->
3535
<enable_default_replies>0</enable_default_replies>
3636
<default_replies/>
3737
<enable_nlp_replies/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" ?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Werules_Chatbot" setup_version="1.0.6" schema_version="1.0.6"/>
3+
<module name="Werules_Chatbot" setup_version="1.0.7" schema_version="1.0.7"/>
44
</config>

Magento2/app/code/Werules/Chatbot/view/adminhtml/templates/system/config/custom_js.phtml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,31 @@
2727
updateCustomKeyUrl(custom_key.value);
2828

2929
var scheduled_clear = document.getElementById('werules_chatbot_danger_general_clear_message_pending');
30-
if (scheduled_clear)
31-
{
32-
if (scheduled_clear.value === '1')
33-
{
30+
if (scheduled_clear) {
31+
if (scheduled_clear.value === '1') {
3432
var schedule_message = document.getElementById('werules_scheduled_clearing');
3533
if (schedule_message)
3634
document.getElementById('werules_scheduled_clearing').style.display = 'block';
3735
}
3836
}
3937

40-
function updateCustomKeyUrl(custom_key)
41-
{
38+
function updateCustomKeyUrl(custom_key) {
4239
var messenger_url = document.getElementById('werules_messenger_url');
4340
var telegram_url = document.getElementById('werules_telegram_url');
4441
var store_url = '<?php echo $baseUrl; ?>';
4542
// messenger_url.href = store_url + 'chatbot/webhook/endpoint/api/messenger/key/' + custom_key;
46-
messenger_url.href = 'https://werules.github.io/chatbot/?key=' + custom_key;
47-
telegram_url.href = store_url + 'chatbot/webhook/endpoint/api/messenger/key/' + custom_key;
43+
messenger_url.href = 'https://werules.github.io/chatbot/?key=' + custom_key + '&base_url=' + store_url;
44+
// telegram_url.href = store_url + 'chatbot/webhook/endpoint/api/messenger/key/' + custom_key; // TODO
4845
}
4946

50-
function generateCustomKey()
51-
{
47+
function generateCustomKey() {
5248
var key_input = document.getElementById('werules_chatbot_general_general_custom_key');
5349
var custom_key = getRandomCustomKey(Math.floor(Math.random() * 4));
5450
key_input.value = custom_key;
5551
// updateCustomKeyUrl(custom_key);
5652
}
5753

58-
function getRandomCustomKey(qty)
59-
{
54+
function getRandomCustomKey(qty) {
6055
var key = '';
6156
for (var i = 0; i <= qty; i++)
6257
key += Math.random().toString(36).substring(2, 15);

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ Go to **System > General Settings > Chatbot Settings**
105105

106106
## Release Notes
107107
### Magento2
108+
- **v1.0.7:**
109+
- Fix unserialization problem [#146](https://github.com/blopa/Magento-Chatbot/issues/146) (thanks [xmav](https://github.com/xmav))
108110
- **v1.0.6:**
109111
- Update license
110112
- Fix issue [#142](https://github.com/blopa/Magento-Chatbot/issues/142)

screenshots/m2/messenger_settings.png

91.7 KB
Loading

0 commit comments

Comments
 (0)