Menu

SuietASSURED Banner

Save

Save

Welcome, Guest
Username: Password: Remember me

TOPIC: Problem exporting account when filter is applied

Problem exporting account when filter is applied 4 days 22 hours ago #57995

  • david.bohorquez
  • david.bohorquez's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
Hi everybody:

I've found a problem, maybe a bug, when I tried to export an accounts list after applied a filter by campaign name. This is the way to reproduce the problem:
  1. Add the field 'campaign_name' to the available fields on layaouts filter and list views using studio
  2. Filter accounts by any campaign, filter works fine
  3. Select all accounts after filter and export them using export on 'bulk action' menu
  4. The page goes blank

As I see on suitecrm.log file, there are a problem with the SQL query:
Query Failed: 
SELECT
		accounts.*, email_addresses.email_address email_address, '' email_addresses_non_primary, accounts.name as account_name,
		users.user_name as assigned_user_name ,accounts_cstm.jjwg_maps_lng_c,accounts_cstm.jjwg_maps_lat_c,accounts_cstm.jjwg_maps_geocode_status_c,accounts_cstm.jjwg_maps_address_c 
	FROM 
		accounts LEFT JOIN users
			ON accounts.assigned_user_id=users.id 
		LEFT JOIN  email_addr_bean_rel 
			on accounts.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module='Accounts' and email_addr_bean_rel.deleted=0 and email_addr_bean_rel.primary_address=1  
		LEFT JOIN email_addresses 
			on email_addresses.id = email_addr_bean_rel.email_address_id  
		LEFT JOIN accounts_cstm 
			ON accounts.id = accounts_cstm.id_c 
	where 
		((campaign_name like 'CAMPAIGN1%')) AND ( accounts.deleted IS NULL OR accounts.deleted=0 )
		: MySQL error 1054: Unknown column 'campaign_name' in 'where clause'
Fri Jan 12 17:18:16 2018 [10499][d7feffe7-41cb-10c1-d063-5a37de0929cc][FATAL] Exception handling in /var/www/html/include/MVC/Controller/SugarController.php:402
Fri Jan 12 17:18:16 2018 [10499][d7feffe7-41cb-10c1-d063-5a37de0929cc][FATAL] Exception in Controller: Database failure. Please refer to suitecrm.log for details.
Fri Jan 12 17:18:16 2018 [10499][d7feffe7-41cb-10c1-d063-5a37de0929cc][FATAL] backtrace:
#0 /var/www/html/include/database/DBManager.php(353): sugar_die('Database failur...')
#1 /var/www/html/include/database/DBManager.php(328): DBManager->registerError('Error exporting...', 'Error exporting...', true)
#2 /var/www/html/include/database/MysqliManager.php(160): DBManager->checkError('Error exporting...', true)
#3 /var/www/html/include/export_utils.php(172): MysqliManager->query('SELECT\n        ...', true, 'Error exporting...')
#4 /var/www/html/export.php(67): export('Accounts')
#5 /var/www/html/include/MVC/Controller/SugarController.php(1014): require_once('/var/www/html/a...')
#6 /var/www/html/include/MVC/Controller/SugarController.php(465): SugarController->handleEntryPoint()
#7 /var/www/html/include/MVC/Controller/SugarController.php(373): SugarController->process()
#8 /var/www/html/include/MVC/SugarApplication.php(105): SugarController->execute()
#9 /var/www/html/index.php(52): SugarApplication->execute()
#10 {main}

There is clear that the where clause is trying to search all records where 'campaign_name' is like the desired Campaign Name, but the column campaign_name does not exist on accounts table or any other table on this query.

Have anyone done something like that or know how to solve this issue? maybe would be better to report it as a bug?

Thanks for your help.
Last Edit: 4 days 22 hours ago by david.bohorquez.
The administrator has disabled public write access.

Problem exporting account when filter is applied 4 days 8 hours ago #58020

  • pgr
  • pgr's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 3537
  • Thank you received: 570
  • Karma: 135
Hi, thanks for the report.

Do you see any Apache errors in php_errors.log? There should be something there if you had a white screen of death.
The administrator has disabled public write access.

Problem exporting account when filter is applied 2 days 10 hours ago #58100

  • david.bohorquez
  • david.bohorquez's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
Hi,

the only error I see on ssl_error_log is:
[Mon Jan 15 10:20:34.578925 2018] [:error] [pid 9557] [client 186.155.36.130:19278] PHP Notice:  Only variables should be passed by reference in /var/www/html/include/export_utils.php on line 556, referer: https://mydomain.com/index.php?module=Accounts&action=index

not too much
Last Edit: 2 days 10 hours ago by david.bohorquez.
The administrator has disabled public write access.

Problem exporting account when filter is applied 2 days 8 hours ago #58108

  • pgr
  • pgr's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 3537
  • Thank you received: 570
  • Karma: 135
When you do a Quick Repair and Rebuild, scroll down to the bottom and check if it gives you a button to sync vardefs with database. if it's there, press it, then try again.
The administrator has disabled public write access.

Problem exporting account when filter is applied 2 days 8 hours ago #58109

  • david.bohorquez
  • david.bohorquez's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
Hi @pgr,

When I do Quick Repair and Rebuild at the botton it says:
Done
Database tables are synced with vardefs


Return to Administration page

Thanks.
The administrator has disabled public write access.

Problem exporting account when filter is applied 2 days 8 hours ago #58110

  • pgr
  • pgr's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 3537
  • Thank you received: 570
  • Karma: 135
If you look directly in the database (via phpMyAdmin or MySQL command-line) do you see a column campaign_name in "accounts" or "accounts_cstm" tables?
The administrator has disabled public write access.

Problem exporting account when filter is applied 2 days 8 hours ago #58111

  • david.bohorquez
  • david.bohorquez's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
Sorry, I've already check at it, but in 'accounts' table there is only a field called 'campaign_id', and in 'accounts_cstm' there is no field similar to 'campaign_name'.

Thanks.

David.
The administrator has disabled public write access.

Problem exporting account when filter is applied 2 days 6 hours ago #58116

  • pgr
  • pgr's Avatar
  • Offline
  • SuiteCRM Is My Life
  • Posts: 3537
  • Thank you received: 570
  • Karma: 135
It looks like the field is not correctly deployed by Studio, it seems incomplete.

Can you try more repairs from Admin / Repairs?

And perhaps try deleting the field and re-creating it? Of, course, you will lose any data you have there, but I suspect you don't have any (if it's not in the database...)

You might have to clear some left-overs from a previously failed deployment - some vardef file, or a row in table fields_meta_data
The administrator has disabled public write access.

Problem exporting account when filter is applied 1 day 22 hours ago #58155

  • cduquev
  • cduquev's Avatar
  • Offline
  • New Member
  • Posts: 1
  • Karma: 0
I have the same problem!. It seems to be a bug on PHP 7 using the "Select All" option using filter from related module. This doesn't happen if I use instead the "Select this page" or if I select the rows one by one and then hit the Bulk action -> Export.

Regards
The administrator has disabled public write access.

Problem exporting account when filter is applied 1 day 9 hours ago #58193

  • david.bohorquez
  • david.bohorquez's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Karma: 0
Hi, pgr:

I've run all the repairs available, deploy again the module, etc., but the problem persist, I will open a bug report for this problem.

Thanks for your help.

David.
The administrator has disabled public write access.
Time to create page: 0.062 seconds
Powered by Kunena Forum