Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[IMP] Ensure that publish doesnt receive empty ids array #1534

Merged
merged 1 commit into from

3 participants

@phproberto

Trying to disable the default item in Joomla CMS finishes in a JModelAdmin::publish with an empty ids array.

http://awesomescreenshot.com/09ag6vbe3

I'm going also to fix CMS to ensure that we do not call this method with an empty array.

Joomlacode tracker issue:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=28990

@pjwiseman

Tested successfully by applying 1534 to the CMS which fixes the issue in 28990.

@pasamio pasamio merged commit e5719ee into joomla:staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +6 −0 libraries/legacy/model/admin.php
View
6 libraries/legacy/model/admin.php
@@ -833,6 +833,12 @@ public function publish(&$pks, $value = 1)
$table = $this->getTable();
$pks = (array) $pks;
+ // Ensure that we do not receive an empty array
+ if (empty($pks))
+ {
+ return true;
+ }
+
// Include the content plugins for the change of state event.
JPluginHelper::importPlugin('content');
Something went wrong with that request. Please try again.