Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F785041
D214.id1110.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Feb 11, 8:07 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Wed, Feb 12, 8:07 PM (9 h, 2 m)
Engine
blob
Format
Raw Data
Handle
564107
Attached To
D214: MINC-149 - Check, that order really exists in "ord_PrintCart" tag
D214.id1110.diff
View Options
Index: branches/5.2.x/units/orders/orders_tag_processor.php
===================================================================
--- branches/5.2.x/units/orders/orders_tag_processor.php
+++ branches/5.2.x/units/orders/orders_tag_processor.php
@@ -108,11 +108,18 @@
function PrintCart($params)
{
$o = '';
+ $o_items = '';
- $params['render_as'] = $params['item_render_as'];
- $tag_params = array_merge($params, Array ('per_page' => -1));
-
- $o_items = $this->Application->ProcessParsedTag(rtrim('orditems.' . $this->Special, '.'), 'PrintList', $tag_params);
+ if ( $this->orderExists($params) ) {
+ $params['render_as'] = $params['item_render_as'];
+ $tag_params = array_merge($params, array('per_page' => -1));
+
+ $o_items = $this->Application->ProcessParsedTag(
+ rtrim('orditems.' . $this->Special, '.'),
+ 'PrintList',
+ $tag_params
+ );
+ }
if ( $o_items ) {
if ( isset($params['header_render_as']) ) {
@@ -202,9 +209,7 @@
function CartNotEmpty($params)
{
- $object = $this->getObject($params);
-
- if ($object->GetDBField('Status') != ORDER_STATUS_INCOMPLETE || $object->GetID() == FAKE_ORDER_ID) {
+ if ( !$this->orderExists($params) ) {
return 0;
}
@@ -219,6 +224,24 @@
return 0;
}
+ /**
+ * Checks order is exists.
+ *
+ * @param array $params Tag params.
+ *
+ * @return boolean
+ */
+ protected function orderExists(array $params)
+ {
+ $object = $this->getObject($params);
+
+ if ( $object->GetDBField('Status') != ORDER_STATUS_INCOMPLETE || $object->GetID() == FAKE_ORDER_ID ) {
+ return false;
+ }
+
+ return true;
+ }
+
function CartIsEmpty($params)
{
return $this->CartNotEmpty($params) ? false : true;
Event Timeline
Log In to Comment