? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
15 Feb 2017

Pull Request for Issue # .

Summary of Changes

This PR fixes some errors on User Profile Plugin on 4.0-dev branch. I saw this error while reviewing the PR #14082

Testing Instructions

  1. Install Joomla 4.0
  2. Enable User Profile Plugin
  3. Edit a user account: Before Patch, you will receive an error Save failed with the following error: Operand should contain 1 column(s) . After patch, error is gone, profile data is being saved properly
  4. Delete a user account. Before patch, you will receive an error Call to a member function getQuery() on unknown. After that, no error, user account is successfully deleted

You will need to apply the patch on PR #14082 before testing this PR

Documentation Changes Required

None

avatar joomdonation joomdonation - open - 15 Feb 2017
avatar joomdonation joomdonation - change - 15 Feb 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2017
Category Front End Plugins
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Feb 2017

I have tested this item successfully on 8abcb1b

Applied also Patch #14082: No Error after saving user profile and enabled User-Profile-Plugin.

Haven't Error before PR like described in Point 4 (Delete a user account. Before patch, you will receive an error Call to a member function getQuery() on unknown).


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14088.

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 15 Feb 2017 - Tested successfully
avatar joomdonation
joomdonation - comment - 15 Feb 2017

Thanks for @franz-wohlkoenig. I don't have any clue why you didn't get the error in step #4, as the error is clear (can be seen from the code $db object not being available before calling $query = $db->getQuery(true) )

avatar joomdonation
joomdonation - comment - 20 Feb 2017

@wilsonge Please help reviewing and merging this PR, too. The code error is clear and we had a successful test, make it easier to test J4

avatar wilsonge
wilsonge - comment - 20 Feb 2017

What's changed here. The delete stuff is 'obvious' the Operand stuff isn't obvious to me what has changed :/

avatar joomdonation
joomdonation - comment - 20 Feb 2017

Before patch, the query is:

INSERT INTO #__user_profiles VALUES ((309, 'profile.address1', '"Address 1"', 1)),((309, 'profile.address2', '"Address 2"', 2)),((309, 'profile.city', '"City"', 3)),((309, 'profile.region', '"Region"', 4)),((309, 'profile.country', '"Country"', 5)),((309, 'profile.postal_code', '"ZIP Code"', 6)),((309, 'profile.phone', '"084"', 7)),((309, 'profile.website', 'false', 8)),((309, 'profile.favoritebook', '"Favourite Book"', 9)),((309, 'profile.aboutme', '"About Me"', 10)),((309, 'profile.dob', '""', 11))

After patch, the query is;

INSERT INTO #__user_profiles VALUES (309, 'profile.address1', '"Address 1"', 1),(309, 'profile.address2', '"Address 2"', 2),(309, 'profile.city', '"City"', 3),(309, 'profile.region', '"Region"', 4),(309, 'profile.country', '"Country"', 5),(309, 'profile.postal_code', '"ZIP Code"', 6),(309, 'profile.phone', '"084"', 7),(309, 'profile.website', 'false', 8),(309, 'profile.favoritebook', '"Favourite Book"', 9),(309, 'profile.aboutme', '"About Me"', 10),(309, 'profile.dob', '""', 11)

There is an extra ( and ) chararacter for each value inserted. ((309, 'profile.address1', '"Address 1"', 1)) for example, is wrong, (309, 'profile.address1', '"Address 1"', 1) is correct.

Hope it is clear now.

avatar csthomas
csthomas - comment - 21 Feb 2017

https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/joomla/database/query.php#L1351

Arguments in values() does not need additional brackets as it was before (J3.7) in raw query.

avatar wilsonge wilsonge - change - 21 Feb 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-02-21 10:17:36
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 21 Feb 2017
avatar wilsonge wilsonge - merge - 21 Feb 2017

Add a Comment

Login with GitHub to post a comment