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

PostgreSQL - return the same string each time of call __toString() on update query with join #13284

Merged
merged 1 commit into from Jan 14, 2017

Conversation

csthomas
Copy link
Contributor

@csthomas csthomas commented Dec 19, 2016

Pull Request for Issue:

  • Update (with join) query (JDatabaseQueryPostgresql) on each call method __toString() generates different string.

Summary of Changes

Testing Instructions

Test by travis.
Code review.

Documentation Changes Required

N/A

@ggppdk
Copy link
Contributor

ggppdk commented Dec 19, 2016

Update query (JDatabaseQueryPostgresql) on each call method __toString() generates different string.

Can you give an example of a query that returns a different string on every call ?
which part of the query is different ?

@csthomas
Copy link
Contributor Author

On joomla that uses postgreSQL:

php > $db = JFactory::getDbo();
php > $q = $db->getQuery(true)->update('#__content a')->set('hits = 1')->innerJoin('#__categories c ON a.catid = c.id')->where('c.id = 5');
php > echo $q;

UPDATE #__content a
SET hits = 1
FROM #__categories c
WHERE c.id = 5 AND a.catid = c.id
php > echo $q;

UPDATE #__content a
SET hits = 1
FROM #__categories c,#__categories c
WHERE c.id = 5 AND a.catid = c.id AND a.catid = c.id
php > echo $q;

UPDATE #__content a
SET hits = 1
FROM #__categories c,#__categories c,#__categories c
WHERE c.id = 5 AND a.catid = c.id AND a.catid = c.id AND a.catid = c.id

@csthomas csthomas changed the title PostgreSQL - return the same string each time of call __toString() on update query PostgreSQL - return the same string each time of call __toString() on update query with join Dec 19, 2016
@waader
Copy link
Contributor

waader commented Dec 27, 2016

I have tested this item ✅ successfully on 71db6b8

I got always the same malformed query and this patch corrected the problem. Thanks!


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

@alikon
Copy link
Contributor

alikon commented Jan 5, 2017

I have tested this item ✅ successfully on 71db6b8


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

@csthomas
Copy link
Contributor Author

csthomas commented Jan 5, 2017

Thanks a lot for the tests.

@jeckodevelopment
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 5, 2017
@wilsonge wilsonge merged commit 417fdbd into joomla:staging Jan 14, 2017
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 14, 2017
@wilsonge wilsonge added this to the Joomla 3.7.0 milestone Jan 14, 2017
@wilsonge
Copy link
Contributor

Nice catch!! Thanks :)

@csthomas csthomas deleted the postgresql_update_query branch January 15, 2017 08:53
rdeutz pushed a commit to rdeutz/joomla-cms that referenced this pull request Jan 17, 2017
wilsonge pushed a commit that referenced this pull request Jan 23, 2017
* tinymce 4.5.2

Version 4.5.2 - January 4, 2017

* Clean up JModelForm

* xml update version

* Catch "expects parameter 2 to be string" error

* Remove multiple parameter from user field

* Remove default value from the field params to inherit from plugin

* It's 2017. Happy New Year

* Some improvements in tests #3: (#13402)

* Some improvements in tests #3:
- call static methods correctly

* Fix T_PAAMAYIM_NEKUDOTAYIM (for all PHP 5.x)

* Remove forgotten call

* Changed a few things after conversation with @mbabker

* Fixes according to @andrepereiradasilva's comments

* Unnecessary double quotes in  /libraries/joomla (#13372)

* Replace unnecessary double quotes in /libraries/joomla

* Formatting

* CS Fix

* Fixes, based on @andrepereiradasilva's comments.

* Change remove string concatenations for some occurrences.

* Fixes, based on @andrepereiradasilva's comments.

* Fixes, based on @andrepereiradasilva's comments.

* Fixes, based on @andrepereiradasilva's comments.

* Fixing search for MySQL (#13571)

* Use $query->castAsChar instead of casting to integer

* Codestyle

* Clean up old code in cache.php file (#12183)

* Clean up in cache - part 1

* Remove old php4 style to catch exception which currently is useless.
* Add shorten version of ternary pperators.

* Add fix for contains()

* Add more email cloaking unit tests and fix email cloaking bug (#13446)

* Rsponsive article edit fields (#13586)

* Fix BS grid (#13560)

* Fixing Showon in plugins/modules/templates (#13549)

* Adding field group to JFormHelper::parseShowOnConditions and rearranged argument order.

* codestyle

* $field->assigned_cat_ids may not exist. (#13570)

* Clean up ModulesModelModule class (#13380)

* Make the calendar work in the subform field (#13153)

* [com_fields] Add Joomla loading overlay when form submit is triggered by category selector change (#13320)

* Added overlay box and message box for submit and reload form after category change

* Removed commented testing code

* Added language strings

* CS fix, added missing spaces

* Used Joomla logo spinner instead of fixed message

* Reverted changes in admin lang file

* CS

* Revert frontend lang changes

* Added Joomla loading overlay to new field form when changing field type

* Added Joomla.loadingLayer show to typeHasChanged JS method too

* PostgreSQL - return the same string each time of call __toString() on update query (#13284)

* TranslateFormat in all other forms (#13158)

* TranslateFormat in all other forms

* Revert for tracks filter bar

* Fix for issue #13531 (#13535)

* Fix for issue #13531
- [AND] and [OR] operators were not functioning correctly. Fixed.
- some cleanup of whitespaces in XML file and removal of rulers when the encapsulated fields are not showing.

* Removed $key, as it was an unused leftover

* CS Fix

* Whitespace Fix

* Whitespace Fix

* Whitespace Fix#2

* Conflict resolution (hopefully, Don't have a complete dev-environment right now.)

* Added css classes to the mod_login submit buttons (#13379)

* Added css classes to the mod_login submit buttons

* Added css classes to the mod_login submit buttons

* Changed class to login-button in both modules

* PHPMailer update (#13575)

* Correcting sidebar display LTR and RTL (replaces #13548) (#13593)

* Fix for Issue #13588 - mod_articles_categories - Fatal error: Class 'ContentHelperRoute' not found... (#13590)

* Update helper.php

Remove JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php');

* Update mod_articles_categories.php

* Make clear Exception messages in JTable (#13603)

* Fix issue where fields is false (#13574)

* Update jQuery Autocomplete to 1.2.27 (#13282)

* Show text "No Information Entered" in users profile when no value is set (#13589)

* Delete UCM content entries when Joomla articles are deleted (#13592)

* [com_fields] Add base list plugin class which activates the list plugin (#13546)

* Add base list plugin class

* Update fieldslistplugin.php

* Fixes #13177: Added where clause with block status (#13545)

* Menu manager for Joomla Backend Menu (#13036)

* Added client id column to menu_type table.
Allow creating and editing of "menutype" records with client_id = 1
Add client_id filters in menu and menu items list views
Sync menu type filter and client_id filter allowing only menu type in the URL query parameter (B/C)
Both Lists now also filtered by client id.
Client id selection updates the menu type list options to show choices only for that client id

TBD:
Reserved menu types: main & menu

* In modal list view we currently hide client_id filter and show only site menu types, will be updated once we have more clear vision.
Menu type assignment to backend mod_menu config from both menu manager and module manager. Though that is not functional within the module itself.

* Add/edit menu item redirect with clientId from list filter.
Load menu item form based on active client id
Menu type dropdown choices limited to active client id value
Show menu-item-type choices (modal) trigger with client id parameter in the url
Switch edit layout based on client id

* Menu item type loading from component metadata xml or mvc not identifies backend and frontend application separately. Not yet able to load menu item type from backend so returns empty list. Front-end is still intact and unaffected.

* Edit menu item and create menu item set to follow client id and menu type value consistenty.
When creating menu item alias, the referenced menu must also belong to same client id.
Client id field removed from form, this should be auto-calculated from the menu type when saving.

* Adding layout metadata xml in backend to reference menu item types as it was in front-end.
Removed unnecessary admin specific layout added earlier as it is so far same as original edit.php, may be added back when needed.
Remove page specific meta data fields from backend component type menu items.
For now disable/unsupport association for backend menu items.
Disallow change of client id for existing menu items, unexpected conflicts may occur if allowed so better be safe.

Ref to #2

* Created each backend menu items using menu manager as a replica of existing Joomla backend menu. These are to be used for testing during upgrading menu module.
language keys are not yet translated. Translation will be done as we are ready with most new or modified language keys application wide.
Backend menu items does not require all those parameters as that with front-end menu items. Therefore segregated entire menu item xml for backend/frontend.

Ref #2

* [a11y] Protostar back to top (#12446)

* [a11y] Protostar - back to top link

* Oops Andre was right

* add anchor for non-js enabled browsers

* Restructure mod_menu to load preset menu items as an option (default). Other options will be the menu-type and will cause us to load from database. Ref #2

* Disallow editing and set to home of protected menu type menu items viz. 'main' and 'menu'
Allow explicit filtering by protected menu type choices in menu items list view. Not limited to #__menutypes table entries only. Unfiltered list still excludes those menu items. (B/C ok)
Menu items created during installation of a component are now saved as published. When unpublished we won't load it in customised menu's component menu container. They will still be loaded irrespective of state as previously when preset is in use. (B/C ok)
Home page can now be set one per client instead of one overall.
Menu module only loads item from 'main' and 'menu' type menu items when requested for component menu items. This filter is now required because we are now going to have other custom menu types for backend which should not be included.

Ref #2

* Load menu items from databases in correct hierarchy. Remove any extra separator type menu items created due to exclusion of certain menu items based on various conditions.
Populate menu items loaded from db into the AdminCssMenu object for final rendering.
Load new installed components menu items dynamically under the specified menu item with “components container” flag. Any unpublished menu items from the protected menutypes (viz. “main” and “menu”) will be skipped.
When loading from system preset menu items, these components menu items are all included regardless of their published state. (B/C ok).

Ref #2

* View manifests for menu item type and related language key updates. ref #2

* Minor mistake fix.

* Translate menu item titles in list view. Ref #2

* Reset the preset menu structure to be same as the current J37 branch state, dropping implicit inclusion of #10657 improvement. Ref #2

* Allow the existing components to leverage the menu/submenu entries in their install manifest for admin menu manager menu link types.
This provides ability to create links for then without requiring them to add layout manifests. Hence, full B/C solution. Ref #2

* Minor fix

* Remove temporary dev phase files

* Preparing for PR, database and install script updates.
Ref #2

* Minor fix

* Codestyle fix

* CS fix

* Don’t sort menu items

* Sort lang keys
Allow ‘component’ as first level alias in admin menu items
Fix lang key
Remove ‘home’ setting from admin menu items

* apply in hathor

* menu item alias check for site only

* Post merge fixes.

* Fixes as suggested by @infograf768

1. Group menu types by client id in lists and default admin menu
2. Hide association tab for admin menu items.
3. Hide client id filter for association mapping modal.

* Add recovery mode for menu where the selected admin menu does not contain link to module manager and/or menu manager.

* minor bug fix

* Remove assoc column for admin menu items.
Make recovery mode message more straight forward.
Change radio to toggle buttons.

* Add SMS to External URL menu item type (#13615)

Allows data like sms://+15555555555 to be used instead of getting "Save Not Permitted"

* Adding the Multilanguage Associations Manager (#13537)

* Merge Associations rewrite

* updated searchtool with the new way

* udpated edit view title

* added contact associationshelper class

* temp fix

* fix for category filter

* added newsfeeds associations helper

* CAPS for params

* lang tag and added a helper function

* added land tags

* code style fix

* better title in associations view

* better title

* use the usual naming

* fix language tag, thanks to brian teeman and twitter :-)

* initial review

* on simple change

* on simple change 2

* simple

* some more helper changes

* Update associations.php

* Update associations.php

* app isn’t set a model property

* correct return value

* simplify code adn use helper method

* use typename directly

* changed the tooltip position

* Correct menu helper

* remove unreacable code

* correcting checked_out

* com_menus

* fixed not supportted message

* installation

* fix menu install

* Spaces -> tabs

* [com_associations] - mssql updates (#13617)

the missed mssql updates for #13537

* [com_fields] Improved description in the "description" tooltip Fixes #13392 (#13557)

* Fixes #13195: Added margin bottom to sidebar menu

* Fixes #13392: Changed description field tooltip

* Fixes #13392: Changed description field tooltip

* Fixes #13392: Changed description field tooltip

* sync admin menu menutype (#13618)

* Routing: Remove IDs from tags URLs, use menu item of tags view as default for tag view (#11166)

* Remove id from tags, use tags list menu item as default for tag

* Code style, remove useless code, feature: first Itemid for tags view, second Itemid for default tag view

* Updating install.xml en-GB administrator (#13623)

* run grunt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants