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

Fixed primary key null not being respected #6914

Closed
wants to merge 1 commit into from

Conversation

roland-d
Copy link
Contributor

Problem

If no primary key value is passed to the publish method it is now not being respected as it is turned into an array, the loaded state is not being used as should. This PR fixes this issue introduced in #6893

Test instructions

  1. Apply pull request Fix JTable publish method error #6900 first

  2. Add the code below to the file administrator/component/com_cpanel/cpanel.php after line 10.
    This will show the problem as we first unpublish the record and then publish it.

     require_once JPATH_ADMINISTRATOR.'/components/com_contact/tables/contact.php';
     $row = JTable::getInstance('Contact', 'ContactTable');
     $row->load(1);
     $row->publish(1, 0);
     $row->publish();
     echo 'Published: ' . $row->published;
  3. Load the administrator control panel and it shows Published: 0. This is wrong because we just published the record.

  4. Apply the patch

  5. Load the administrator control panel and it shows Published: 1. This is correct because we just published the record.

  6. Testing finished

@joomdonation
Copy link
Contributor

@test: Success.

@zero-24
Copy link
Contributor

zero-24 commented May 10, 2015

@test success RTC Thanks 😄

@zero-24 zero-24 added the RTC This Pull Request is Ready To Commit label May 10, 2015
@roland-d roland-d closed this in cb15afe May 10, 2015
@Kubik-Rubik
Copy link
Member

Thank you @roland-d for this fix. Merged this PR!

@Kubik-Rubik Kubik-Rubik added this to the Joomla! 3.4.2 milestone May 10, 2015
johanjanssens pushed a commit to joomlatools/joomla-fork that referenced this pull request Jun 19, 2015
@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
@roland-d roland-d deleted the publish-null branch April 13, 2016 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants