Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Out of Sync Data in DICT
Out of Sync Data in DICT [message #5909] Thu, 29 September 2016 12:54 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Notice that in dict/sql/mysql/dict_data.sql there are references to a column_id 'language_code' related to the mnu_user table. However, in the mnu_user schema there is no such a column. I suspect that some time in history 'language_code' was renamed to 'language_id' and remnants of this evolution still hiding in the DICT module. In v1.97 for example, the file dict-data.sql dates back to 2014.

When you try to re-import the columns in mnu_user via the DICT module (for example to solve http:// radicore.org/fud/index.php?t=msg&th=2293&start=0& ;amp ;amp ;amp ;amp ;), you will detect a hidden error with a debugger during the process:
[language_code] 0: Cannot delete - record still linked to DICT_RELATED_COLUMN table
This is a hidden error because it does not show up on the screen. If you then unsuspectingly click 'Export to PHP' you will have overwritten the good references to 'language_id' with bad references to 'language_code' in mnu_user_dict.inc.

Now, when you try to create a new user:
Fatal Error: MySQL: Unknown column 'language_code' in 'field list' (# 1054)

Interestingly, when you try to log out, you will have found an unrelated bug (http:// radicore.org/fud/index.php?t=msg&th=2294&start=0& ;amp ;amp ;amp ;amp ;) :
Fatal Error: MySQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), (SELECT role_desc FROM mnu_user_role LEFT JOIN mnu_role ON (mnu_role.role_id=' at line 1 (# 1064)

SQL query: SELECT SQL_CALC_FOUND_ROWS mnu_user.*, mnu_account.account_name, (SELECT GROUP_CONCAT(role_desc ORDER BY is_primary DESC, mnu_user_role.role_id ASC SEPARATOR ', ') FROM mnu_user_role LEFT JOIN mnu_role ON (mnu_role.role_id=mnu_user_role.role_id) WHERE user_id=mnu_user.user_id) AS role_list), (SELECT role_desc FROM mnu_user_role LEFT JOIN mnu_role ON (mnu_role.role_id=mnu_user_role.role_id) WHERE user_id=mnu_user.user_id AND is_primary='Y' LIMIT 1) AS role_id FROM mnu_user LEFT JOIN mnu_account ON (mnu_account.rdcaccount_id=mnu_user.rdcaccount_id) WHERE mnu_user.user_id='EKL' ORDER BY mnu_user.user_name asc

So, what I did to re-import the columns of mnu_user:
(1) Make sure you first delete the parent relationship with mnu_language.
(2) Re-import the columns of mnu_user.
(3) Re-create the parent relationship with the mnu_language table.
(4) Export to PHP

For future releases, might want to think about:
(1) Fix code to show above mentioned hidden error on the screen.
(2) Update dict_data.sql file for new installs.
(3) Migration file to update data in DICT database to reflect schema changes in AUDIT, MENU and WORKFLOW.

[Updated on: Thu, 29 September 2016 13:27]

Report message to a moderator

Re: Out of Sync Data in DICT [message #5912 is a reply to message #5909] Fri, 30 September 2016 05:01 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
I normally update the ???.dict_export.sql file after every database update, but I must have missed it on this occasion. Please see the attached file which should be up-to-date.

Re: Out of Sync Data in DICT [message #5916 is a reply to message #5912] Fri, 30 September 2016 11:47 Go to previous message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Thank you.
Previous Topic: Auto assign user in workflow that starts with ADD1 task
Next Topic: WORKFLOW template_id
Goto Forum:
  


Current Time: Tue Apr 16 14:27:04 EDT 2024

Total time taken to generate the page: 0.00863 seconds