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

fix(projects): Add missing comma #31875

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

adityahase
Copy link
Member

Trying to set in User field in Users child table in Project throws the following error.

select name, concat_ws(' ', first_name, middle_name, last_name)
		from `tabUser`
		where enabled=1
			and name not in ("Guest", "Administrator")
			and (name like %(txt)s
				or full_name like %(txt)s)
			 
		order by
			(case when locate(%(_txt)s, name) > 0 then locate(%(_txt)s, name) else 99999 end),
			(case when locate(%(_txt)s, full_name) > 0 then locate(%(_txt)s, full_name) else 99999 end)
			idx desc,
			name, full_name
		limit %(page_len)s offset %(start)s {'txt': '%', '_txt': '', 'start': 0, 'page_len': 20}
Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1598, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/search.py", line 62, in search_link
    search_widget(
  File "apps/frappe/frappe/desk/search.py", line 122, in search_widget
    raise e
  File "apps/frappe/frappe/desk/search.py", line 110, in search_widget
    frappe.response["values"] = frappe.call(
  File "apps/frappe/frappe/__init__.py", line 1598, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/search.py", line 326, in wrapper
    return fn(**kwargs)
  File "apps/erpnext/erpnext/projects/doctype/project/project.py", line 372, in get_users_for_project
    return frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 209, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'idx desc,\n\t\t\tname, full_name\n\t\tlimit 20 offset 0' at line 11")

Added with #31360. Needs to be backported to version-14.

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Aug 17, 2022
@codecov
Copy link

codecov bot commented Aug 17, 2022

Codecov Report

Merging #31875 (d38778e) into develop (2d04e71) will increase coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop   #31875      +/-   ##
===========================================
+ Coverage    63.36%   63.38%   +0.01%     
===========================================
  Files          813      813              
  Lines        57560    57560              
===========================================
+ Hits         36471    36482      +11     
+ Misses       21089    21078      -11     
Impacted Files Coverage Δ
erpnext/projects/doctype/project/project.py 51.77% <ø> (+0.32%) ⬆️
...t/product_bundle_balance/product_bundle_balance.py 79.54% <0.00%> (-15.91%) ⬇️
erpnext/accounts/party.py 77.71% <0.00%> (-4.46%) ⬇️
...rpnext/stock/report/stock_balance/stock_balance.py 86.04% <0.00%> (-1.87%) ⬇️
erpnext/stock/doctype/item_price/item_price.py 92.98% <0.00%> (-1.76%) ⬇️
erpnext/support/doctype/issue/issue.py 64.28% <0.00%> (-0.96%) ⬇️
erpnext/crm/doctype/lead/lead.py 70.51% <0.00%> (-0.86%) ⬇️
erpnext/accounts/doctype/pricing_rule/utils.py 69.84% <0.00%> (-0.52%) ⬇️
...pnext/accounts/report/gross_profit/gross_profit.py 73.80% <0.00%> (-0.37%) ⬇️
erpnext/stock/get_item_details.py 80.20% <0.00%> (-0.15%) ⬇️
... and 16 more

@deepeshgarg007
Copy link
Member

@Mergifyio backport version-13-hotfix version-14-hotfix

@mergify
Copy link
Contributor

mergify bot commented Aug 18, 2022

backport version-13-hotfix version-14-hotfix

✅ Backports have been created

@deepeshgarg007 deepeshgarg007 merged commit 86bdddd into frappe:develop Aug 18, 2022
deepeshgarg007 added a commit that referenced this pull request Aug 18, 2022
…-31875

fix(projects): Add missing comma (backport #31875)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants