Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Joomla CMS [#27257] Fix a typo in the publish method of jtablenested.Originally identified i... #680

Merged
merged 4 commits into from

4 participants

@elinw

Fix a typo in the publish method of jtablenested.Originally identified in CMS

tracker issue #27257

@joomla-jenkins
Collaborator

Unit testing complete. There were 0 failures and 0 errors from 1971 tests and 11142 assertions.
Checkstyle analysis reported 199 warnings and 0 errors.

libraries/joomla/database/tablenested.php
@@ -974,7 +974,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
// Update and cascade the publishing state.
$query = $this->_db->getQuery(true)->update($this->_db->quoteName($this->_tbl))->set('published = ' . (int) $state)
- ->where('(lft > ' . (int) $this->lft . ' AND rgt < ' . (int) $this->rgt . ')' . ' OR ' . $k . ' = ' . (int) $pk);
+ ->where('(lft > ' . (int) $node->lft . ' AND rgt < ' . (int) $this->rgt . ')' . ' OR ' . $k . ' = ' . (int) $pk);

patch incomplete the second this should be node too.

  • ->where('(lft > ' . (int) $this->lft . ' AND rgt < ' . (int) $this->rgt . ')' . ' OR ' . $k . ' = ' . (int) $pk);
  • ->where('(lft > ' . (int) $node->lft . ' AND rgt < ' . (int) $node->rgt . ')' . ' OR ' . $k . ' = ' . (int) $pk);

(btw. the worst readable coding style. some features are nice to have but should not be used to improve readability and compatibility)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@joomla-jenkins
Collaborator

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1971 tests and 11142 assertions.
Checkstyle analysis reported 199 warnings and 0 errors.

@joomla-jenkins
Collaborator

Build triggered by changes to the head.

Unit testing complete. There were 0 failures and 0 errors from 1971 tests and 11142 assertions.
Checkstyle analysis reported 199 warnings and 0 errors.

@chdemko chdemko merged commit 2396dd9 into joomla:staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 29, 2011
  1. @elinw

    Fix a typo in the publish method of jtablenested.Originally identifie…

    elinw authored
    …d in CMS
    
    tracker issue #27257
Commits on Dec 31, 2011
  1. @elinw

    squash!

    elinw authored
  2. @elinw

    Code style

    elinw authored
  3. @elinw
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 libraries/joomla/database/tablenested.php
View
4 libraries/joomla/database/tablenested.php
@@ -872,7 +872,7 @@ public function store($updateNulls = false)
* not allow you to set a publishing state on a node with a checked out child.
*
* @param mixed $pks An optional array of primary key values to update. If not
- * set the instance property value is used.
+ * set the instance property value is used.
* @param integer $state The publishing state. eg. [0 = unpublished, 1 = published]
* @param integer $userId The user id of the user performing the operation.
*
@@ -974,7 +974,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
// Update and cascade the publishing state.
$query = $this->_db->getQuery(true)->update($this->_db->quoteName($this->_tbl))->set('published = ' . (int) $state)
- ->where('(lft > ' . (int) $this->lft . ' AND rgt < ' . (int) $this->rgt . ')' . ' OR ' . $k . ' = ' . (int) $pk);
+ ->where('(lft > ' . (int) $node->lft . ' AND rgt < ' . (int) $node->rgt . ')' . ' OR ' . $k . ' = ' . (int) $pk);
$this->_db->setQuery($query);
// Check for a database error.
Something went wrong with that request. Please try again.