Magemaven_OrderComment - Version 1.0.4

Version Notes

Bugfix release.

Fixed No orders in magento backend error
Fixed integrity constraint violation error while filtering
Fixed fatal error in Orders tab of customer edit screen

Download this release

Release Info

Developer Sergey Storchay
Extension Magemaven_OrderComment
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.4

app/code/community/Magemaven/OrderComment/Block/Adminhtml/Sales/Order/Grid.php CHANGED
@@ -12,6 +12,16 @@
12
  */
13
  class Magemaven_OrderComment_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
14
  {
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * Retrieve collection class
17
  *
@@ -33,10 +43,18 @@ class Magemaven_OrderComment_Block_Adminhtml_Sales_Order_Grid extends Mage_Admin
33
 
34
  // Add order comment to grid
35
  $this->addColumn('ordercomment', array(
36
- 'header' => Mage::helper('ordercomment')->__('Order Comment'),
37
- 'index' => 'ordercomment',
 
38
  ));
39
 
 
 
 
 
 
 
 
40
  return $this;
41
  }
42
  }
12
  */
13
  class Magemaven_OrderComment_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
14
  {
15
+ /**
16
+ * Columns, that become ambiguous after join
17
+ *
18
+ * @var array
19
+ */
20
+ protected $_ambiguousColumns = array(
21
+ 'status',
22
+ 'created_at',
23
+ );
24
+
25
  /**
26
  * Retrieve collection class
27
  *
43
 
44
  // Add order comment to grid
45
  $this->addColumn('ordercomment', array(
46
+ 'header' => Mage::helper('ordercomment')->__('Order Comment'),
47
+ 'index' => 'ordercomment',
48
+ 'filter_index' => 'ordercomment_table.comment',
49
  ));
50
 
51
+ // Fix integrity constraint violation in SELECT
52
+ foreach ($this->_ambiguousColumns as $index) {
53
+ if (isset($this->_columns[$index])) {
54
+ $this->_columns[$index]->setFilterIndex('main_table.' . $index);
55
+ }
56
+ }
57
+
58
  return $this;
59
  }
60
  }
app/code/community/Magemaven/OrderComment/Model/Resource/Order/Grid/Collection.php CHANGED
@@ -25,11 +25,11 @@ class Magemaven_OrderComment_Model_Resource_Order_Grid_Collection extends Mage_S
25
  $this->getSelect()->joinLeft(
26
  array('ordercomment_table' => $this->getTable('sales/order_status_history')),
27
  'main_table.entity_id = ordercomment_table.parent_id AND ordercomment_table.comment IS NOT NULL',
28
- 'ordercomment_table.comment AS ordercomment'
 
 
29
  )->group('main_table.entity_id');
30
 
31
  return $this;
32
  }
33
-
34
-
35
- }
25
  $this->getSelect()->joinLeft(
26
  array('ordercomment_table' => $this->getTable('sales/order_status_history')),
27
  'main_table.entity_id = ordercomment_table.parent_id AND ordercomment_table.comment IS NOT NULL',
28
+ array(
29
+ 'ordercomment' => 'ordercomment_table.comment',
30
+ )
31
  )->group('main_table.entity_id');
32
 
33
  return $this;
34
  }
35
+ }
 
 
app/code/community/Magemaven/OrderComment/etc/config.xml CHANGED
@@ -15,7 +15,7 @@
15
  <config>
16
  <modules>
17
  <Magemaven_OrderComment>
18
- <version>1.0.3.0</version>
19
  </Magemaven_OrderComment>
20
  </modules>
21
  <global>
@@ -30,9 +30,7 @@
30
  </ordercomment_resource>
31
  <sales_resource>
32
  <rewrite>
33
- <order_grid_collection>
34
- Magemaven_OrderComment_Model_Mysql4_Order_Grid_Collection
35
- </order_grid_collection>
36
  </rewrite>
37
  </sales_resource>
38
  </models>
15
  <config>
16
  <modules>
17
  <Magemaven_OrderComment>
18
+ <version>1.0.4.0</version>
19
  </Magemaven_OrderComment>
20
  </modules>
21
  <global>
30
  </ordercomment_resource>
31
  <sales_resource>
32
  <rewrite>
33
+ <order_grid_collection>Magemaven_OrderComment_Model_Mysql4_Order_Grid_Collection</order_grid_collection>
 
 
34
  </rewrite>
35
  </sales_resource>
36
  </models>
package.xml CHANGED
@@ -1,20 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magemaven_OrderComment</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">AFL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Optional comment for customer orders.</summary>
10
  <description>Allows customer to specify optional comment during order placing.</description>
11
- <notes>Added order comment column to orders grid&#xD;
12
- Tested and updated to work with Magento 1.4&#xD;
13
- Tested and updated to work with Magento 1.5</notes>
 
 
14
  <authors><author><name>Sergey Storchay</name><user>magemaven</user><email>r8@r8.com.ua</email></author></authors>
15
- <date>2012-02-19</date>
16
- <time>17:23:01</time>
17
- <contents><target name="mageetc"><dir name="modules"><file name="Magemaven_OrderComment.xml" hash="1722cb37ea9d60fcd2d540f705cf5dfb"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="ordercomment"><dir name="checkout"><file name="agreements.phtml" hash="19c7a999d95179511b43855993c7e224"/></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Magemaven"><dir name="OrderComment"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="a3f02c096eb7d405c90aa0457b72ff83"/></dir></dir></dir><dir name="Checkout"><file name="Agreements.php" hash="eb070d363d8d2e95681925d05f0730a7"/></dir></dir><dir name="Helper"><file name="Data.php" hash="210fa2d4d4c47dc41d0dc8c9d9a64a3e"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Order"><dir name="Grid"><file name="Collection.php" hash="d9cd9897fa42c4075b41d139b64892e4"/></dir></dir></dir><file name="Observer.php" hash="7dccb4842a7b9ac6b22c1622f78ab5e4"/><dir name="Resource"><dir name="Order"><dir name="Grid"><file name="Collection.php" hash="737ec71a824a44470d3948e27cc62cff"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="5284802844c3ac456631d228f6ba178a"/></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magemaven_OrderComment</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/academic.php">AFL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Optional comment for customer orders.</summary>
10
  <description>Allows customer to specify optional comment during order placing.</description>
11
+ <notes>Bugfix release.&#xD;
12
+ &#xD;
13
+ Fixed No orders in magento backend error&#xD;
14
+ Fixed integrity constraint violation error while filtering&#xD;
15
+ Fixed fatal error in Orders tab of customer edit screen</notes>
16
  <authors><author><name>Sergey Storchay</name><user>magemaven</user><email>r8@r8.com.ua</email></author></authors>
17
+ <date>2012-03-11</date>
18
+ <time>08:35:33</time>
19
+ <contents><target name="mageetc"><dir name="modules"><file name="Magemaven_OrderComment.xml" hash="1722cb37ea9d60fcd2d540f705cf5dfb"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="ordercomment"><dir name="checkout"><file name="agreements.phtml" hash="19c7a999d95179511b43855993c7e224"/></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Magemaven"><dir name="OrderComment"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="785cc0f1a74978d9b1f6b9015ac1bd20"/></dir></dir></dir><dir name="Checkout"><file name="Agreements.php" hash="eb070d363d8d2e95681925d05f0730a7"/></dir></dir><dir name="Helper"><file name="Data.php" hash="210fa2d4d4c47dc41d0dc8c9d9a64a3e"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Order"><dir name="Grid"><file name="Collection.php" hash="d9cd9897fa42c4075b41d139b64892e4"/></dir></dir></dir><file name="Observer.php" hash="7dccb4842a7b9ac6b22c1622f78ab5e4"/><dir name="Resource"><dir name="Order"><dir name="Grid"><file name="Collection.php" hash="2cb24e5003b67ab377cda26b178ff087"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="0ccad17dc85ced4b48ac12d9806139ca"/></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
22
  </package>