Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table nested - problems when publishing/unpublihsing Items #15662

Closed
PhocaCz opened this issue Apr 28, 2017 · 2 comments
Closed

Table nested - problems when publishing/unpublihsing Items #15662

PhocaCz opened this issue Apr 28, 2017 · 2 comments

Comments

@PhocaCz
Copy link
Contributor

PhocaCz commented Apr 28, 2017

Steps to reproduce the issue

Install extension, e.g. Phoca Guestbook, add a post message and publish/unpublish it in administration. You get success message but nothing changes.

It worked since version Joomla! 3.0.0 - to version 3.6.4. In version 3.6.5 there was this change made:

file:
libraries\joomla\table\nested.php
line: cca 1022
FROM:

// Update and cascade the publishing state.
			$query2->clear()
				->update($this->_db->quoteName($this->_tbl))
				->set('published = ' . (int) $state)
				->where('(lft > ' . (int) $node->lft . ' AND rgt < ' . (int) $node->rgt . ') OR ' . $k . ' = ' . (int) $pk);
			$this->_db->setQuery($query)->execute();

TO:
$this->recursiveUpdatePublishedColumn($pk, $state);

Expected result

Item will be published/unpublished

Actual result

Success is returned but no action done

System information (as much as possible)

Joomla! 3.6.4 - OK
Joomla! 3.6.5 - 3.0.7 - NOT OK

PHP7

Additional comments

@csthomas
Copy link
Contributor

The quick solution is to run a query:

UPDATE `#__phocaguestbook_items` SET `published` = '1' WHERE `j37_phocaguestbook_items`.`id` = 1;

The new code requires to have published column equal to 1 for ROOT row.

@PhocaCz
Copy link
Contributor Author

PhocaCz commented Apr 28, 2017

Hi, thank you for the info, yes I see it now. The root must be published since Joomla! 3.6.5 - I am working now on update.

When the root is published, then standard method to publish/unpublish the items through nested table class (including testing of parent elements, etc.) works again.

So this can be closed (for other developers: since Joomla! 3.6.5 root level must be set as "publish"

Thank you.

@PhocaCz PhocaCz closed this as completed Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants