alsoviewed - Version 1.3.1

Version Notes

- Fixed possible error during log processing, if some products where deleted from database.

Download this release

Release Info

Developer Vova Yatsyuk
Extension alsoviewed
Version 1.3.1
Comparing to
See all releases


Code changes from version 1.3.0 to 1.3.1

app/code/community/Yavva/Alsoviewed/Model/Resource/Log.php CHANGED
@@ -38,6 +38,8 @@ class Yavva_Alsoviewed_Model_Resource_Log extends Mage_Core_Model_Resource_Db_Ab
38
  */
39
  public function getGroupedRelations()
40
  {
 
 
41
  $adapter = $this->_getReadAdapter();
42
  $select = $adapter->select()
43
  ->from($this->getMainTable(), array(
@@ -60,4 +62,39 @@ class Yavva_Alsoviewed_Model_Resource_Log extends Mage_Core_Model_Resource_Db_Ab
60
  {
61
  return $this->_getWriteAdapter()->delete($this->getMainTable(), $where);
62
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
38
  */
39
  public function getGroupedRelations()
40
  {
41
+ $this->cleanOrphans();
42
+
43
  $adapter = $this->_getReadAdapter();
44
  $select = $adapter->select()
45
  ->from($this->getMainTable(), array(
62
  {
63
  return $this->_getWriteAdapter()->delete($this->getMainTable(), $where);
64
  }
65
+
66
+ /**
67
+ * Remove orphans records from table
68
+ *
69
+ * @return int Number of deleted records
70
+ */
71
+ public function cleanOrphans()
72
+ {
73
+ $tableName = Mage::getModel('core/resource')
74
+ ->getTableName('catalog_product_entity');
75
+
76
+ $adapter = $this->_getReadAdapter();
77
+ $select = $adapter->select();
78
+
79
+ $select->from($this->getMainTable(), 'entity_id')
80
+ ->joinLeft(
81
+ array('e' => $tableName),
82
+ 'product_id = e.entity_id',
83
+ array()
84
+ )
85
+ ->orWhere('e.entity_id IS NULL');
86
+
87
+ $select->joinLeft(
88
+ array('e2' => $tableName),
89
+ 'related_product_id = e2.entity_id',
90
+ array()
91
+ )
92
+ ->orWhere('e2.entity_id IS NULL');
93
+
94
+ $ids = $adapter->fetchCol($select);
95
+ if (!$ids) {
96
+ return 0;
97
+ }
98
+ return $this->clean(array('entity_id IN (?)' => $ids));
99
+ }
100
  }
app/code/community/Yavva/Alsoviewed/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Yavva_Alsoviewed>
5
- <version>1.3.0</version>
6
  </Yavva_Alsoviewed>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Yavva_Alsoviewed>
5
+ <version>1.3.1</version>
6
  </Yavva_Alsoviewed>
7
  </modules>
8
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>alsoviewed</name>
4
- <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
@@ -43,17 +43,12 @@ Widget provides ability to recommend products on any page by additional activiti
43
  - Simple and clean design&#xD;
44
  - Responsive css&#xD;
45
  </description>
46
- <notes>View release notes at https://github.com/vovayatsyuk/magento-alsoviewed/releases/tag/1.3.0&#xD;
47
- &#xD;
48
- - Security fix to _isAllowed method (strtolower)&#xD;
49
- - Removed non-working "Save" button from relations page&#xD;
50
- - Search crawlers and bots are no longer affects product relations&#xD;
51
- - Added ability to ignore specific IP addresses&#xD;
52
- - Added ability to create new and manage existing relations from backend `Product Edit` page</notes>
53
  <authors><author><name>Vova Yatsyuk</name><user>VovaYatsyuk</user><email>vova.yatsyuk@gmail.com</email></author></authors>
54
- <date>2015-08-13</date>
55
- <time>20:06:45</time>
56
- <contents><target name="magecommunity"><dir name="Yavva"><dir name="Alsoviewed"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Relations.php" hash="cc7fa402cb6e41f0d445e13a35c28c05"/></dir></dir></dir></dir><dir name="Log"><file name="Grid.php" hash="6661435fdb8e525775adf990a90d11c4"/></dir><file name="Log.php" hash="cb3cca5ff29b80044e7943d376dc5993"/><dir name="Relations"><dir name="Edit"><file name="Form.php" hash="0ad20532cb04c4c850fe1398598e6588"/></dir><file name="Edit.php" hash="1afce837cf4bd29beb1cc8f38d4065b6"/><file name="Grid.php" hash="e10da78030dbfb1ecbb32f6df82ddfa1"/></dir><file name="Relations.php" hash="5a8504dde3a69da03151bd75c0a59120"/></dir><file name="Products.php" hash="68240b69f626dd3c6283d1144d18e214"/><dir name="Widget"><file name="Products.php" hash="4fad1d2e4c32ed756c3b5fc988edd5a2"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4712c5c02e1873ffbb21a18d4b6084bc"/></dir><dir name="Model"><file name="Basis.php" hash="ff0ba6ceadd3b99d5ac4825ae109a6b0"/><file name="Observer.php" hash="d4a7929679224d67fa18c2054c93a847"/><file name="Relation.php" hash="506d2fa53e2e342030bdfb976a2f0e00"/><dir name="Resource"><dir name="Collection"><file name="Abstract.php" hash="6d996d6b7643f1b3cc3c0db3d5440011"/></dir><dir name="Log"><file name="Collection.php" hash="790509f4a4e74cc007adae600c0d8a1b"/></dir><file name="Log.php" hash="d79d4a97ba3303dfa3e042ec34c2e0e3"/><dir name="Relation"><file name="Collection.php" hash="be05b1351c8703f1157b6f552612ffa8"/></dir><file name="Relation.php" hash="f25eeeb7330853418226ca65baa47846"/></dir><file name="Session.php" hash="9ba3b43dec9458cc13cb6c6e7efbef05"/><dir name="System"><dir name="Config"><dir name="Source"><file name="ListMode.php" hash="d3480dc016dc0ff9e2e23ab210cf9756"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Alsoviewed"><file name="LogController.php" hash="34ae25cc085adf4875be235feb4d9d63"/><file name="ProductController.php" hash="39c67faecdc13547714a63237487d831"/><file name="RelationsController.php" hash="6ba4c0a8b073c0dbf604932250d0e054"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ff26af98f8e1eef8d902eca84da6d3aa"/><file name="config.xml" hash="848be336a98730fca7503720c4e7725f"/><file name="system.xml" hash="ed3e157796335dbcf9e6cc96f57ada25"/><file name="widget.xml" hash="7d8c523d78cc46b203f440cc9be9a356"/></dir><dir name="sql"><dir name="yavva_alsoviewed_setup"><file name="install-1.0.0.php" hash="8ed81d46895731990b7c2066bfcc353d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><dir name="yavva"><file name="alsoviewed.xml" hash="cdc76c11b4dd573f4d891042714e92cf"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="yavva"><file name="alsoviewed.xml" hash="df953c9808d2e6ca186f36bc8ca4aac4"/></dir></dir><dir name="template"><dir name="yavva"><dir name="alsoviewed"><file name="products.phtml" hash="d55af4e92a7fbe929c10b81a804ddffe"/><dir name="wrapper"><file name="block.phtml" hash="ec9cb02d52f4ea8756a24438d26def64"/><file name="collateral.phtml" hash="0354a4c8f3466edc2d3bb5fb0a0b75f7"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Yavva_Alsoviewed.xml" hash="4eedb69f4c1fc39a1e4170694a19c3f8"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Yavva_Alsoviewed.csv" hash="abdd5870a9969bf9eb6ee89019b5ebb7"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="yavva"><dir name="alsoviewed"><dir name="css"><file name="alsoviewed.css" hash="2eea21636a6bf099f2387c4f992b4c31"/></dir></dir></dir></dir></dir></dir></target></contents>
57
  <compatible/>
58
- <dependencies><required><php><min>5.1.0</min><max>7.0.0</max></php></required></dependencies>
59
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>alsoviewed</name>
4
+ <version>1.3.1</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
43
  - Simple and clean design&#xD;
44
  - Responsive css&#xD;
45
  </description>
46
+ <notes>- Fixed possible error during log processing, if some products where deleted from database.&#xD;
47
+ </notes>
 
 
 
 
 
48
  <authors><author><name>Vova Yatsyuk</name><user>VovaYatsyuk</user><email>vova.yatsyuk@gmail.com</email></author></authors>
49
+ <date>2016-11-01</date>
50
+ <time>19:33:31</time>
51
+ <contents><target name="magecommunity"><dir name="Yavva"><dir name="Alsoviewed"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Relations.php" hash="cc7fa402cb6e41f0d445e13a35c28c05"/></dir></dir></dir></dir><dir name="Log"><file name="Grid.php" hash="6661435fdb8e525775adf990a90d11c4"/></dir><file name="Log.php" hash="cb3cca5ff29b80044e7943d376dc5993"/><dir name="Relations"><dir name="Edit"><file name="Form.php" hash="0ad20532cb04c4c850fe1398598e6588"/></dir><file name="Edit.php" hash="1afce837cf4bd29beb1cc8f38d4065b6"/><file name="Grid.php" hash="e10da78030dbfb1ecbb32f6df82ddfa1"/></dir><file name="Relations.php" hash="5a8504dde3a69da03151bd75c0a59120"/></dir><file name="Products.php" hash="68240b69f626dd3c6283d1144d18e214"/><dir name="Widget"><file name="Products.php" hash="4fad1d2e4c32ed756c3b5fc988edd5a2"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4712c5c02e1873ffbb21a18d4b6084bc"/></dir><dir name="Model"><file name="Basis.php" hash="ff0ba6ceadd3b99d5ac4825ae109a6b0"/><file name="Observer.php" hash="d4a7929679224d67fa18c2054c93a847"/><file name="Relation.php" hash="506d2fa53e2e342030bdfb976a2f0e00"/><dir name="Resource"><dir name="Collection"><file name="Abstract.php" hash="6d996d6b7643f1b3cc3c0db3d5440011"/></dir><dir name="Log"><file name="Collection.php" hash="790509f4a4e74cc007adae600c0d8a1b"/></dir><file name="Log.php" hash="4c077ebe19143b8dd1fee062dca206ec"/><dir name="Relation"><file name="Collection.php" hash="be05b1351c8703f1157b6f552612ffa8"/></dir><file name="Relation.php" hash="f25eeeb7330853418226ca65baa47846"/></dir><file name="Session.php" hash="9ba3b43dec9458cc13cb6c6e7efbef05"/><dir name="System"><dir name="Config"><dir name="Source"><file name="ListMode.php" hash="d3480dc016dc0ff9e2e23ab210cf9756"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Alsoviewed"><file name="LogController.php" hash="34ae25cc085adf4875be235feb4d9d63"/><file name="ProductController.php" hash="39c67faecdc13547714a63237487d831"/><file name="RelationsController.php" hash="6ba4c0a8b073c0dbf604932250d0e054"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ff26af98f8e1eef8d902eca84da6d3aa"/><file name="config.xml" hash="4003e209b129411d92697e9135833e1b"/><file name="system.xml" hash="ed3e157796335dbcf9e6cc96f57ada25"/><file name="widget.xml" hash="7d8c523d78cc46b203f440cc9be9a356"/></dir><dir name="sql"><dir name="yavva_alsoviewed_setup"><file name="install-1.0.0.php" hash="8ed81d46895731990b7c2066bfcc353d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="layout"><dir name="yavva"><file name="alsoviewed.xml" hash="cdc76c11b4dd573f4d891042714e92cf"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="yavva"><file name="alsoviewed.xml" hash="df953c9808d2e6ca186f36bc8ca4aac4"/></dir></dir><dir name="template"><dir name="yavva"><dir name="alsoviewed"><file name="products.phtml" hash="d55af4e92a7fbe929c10b81a804ddffe"/><dir name="wrapper"><file name="block.phtml" hash="ec9cb02d52f4ea8756a24438d26def64"/><file name="collateral.phtml" hash="0354a4c8f3466edc2d3bb5fb0a0b75f7"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Yavva_Alsoviewed.xml" hash="4eedb69f4c1fc39a1e4170694a19c3f8"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Yavva_Alsoviewed.csv" hash="abdd5870a9969bf9eb6ee89019b5ebb7"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="yavva"><dir name="alsoviewed"><dir name="css"><file name="alsoviewed.css" hash="2eea21636a6bf099f2387c4f992b4c31"/></dir></dir></dir></dir></dir></dir></target></contents>
52
  <compatible/>
53
+ <dependencies><required><php><min>5.1.0</min><max>7.1.0</max></php></required></dependencies>
54
  </package>