YetiForceCompany / YetiForceCRM

Our team created for you one of the most innovative CRM systems that supports mainly business processes and allows for customization according to your needs. Be ahead of your competition and implement YetiForce!
https://yetiforce.com
Other
1.72k stars 742 forks source link

[bug] Invisible records in list view #12747

Closed vovpff closed 4 years ago

vovpff commented 4 years ago

🐞 bug report

⁉️ Describe the bug

After update I get very strange List View condition when logged as usual user: I can't see some records in list view. I tried to find some rules of this magic and noticed what I can't see records what was created by admin user. This records visible in list view for admin but invisible for all other users (I'm not use private and sharing, all data available for all users). For example I can't see PRO1-PRO808 products because they created by admin product with PRO809 visible. If I put name of missing products to global search field I can find them in modal popup, I can open them and edit if user has rights for modification.

In vtiger_crmentity table users column filled with Id's of all available users.

image

image

image

πŸ‘· Testing

πŸ“· Screenshot of configuration

πŸ“ PHP/Apache/Nginx/Browser/CRM Logs

Logs absolutely clear. Update logs is here https://github.com/YetiForceCompany/YetiForceCRM/issues/12724#issuecomment-600047675

🌍 Your Environment

Environment Version / Name
YetiForce 5.3 SP1

ConfReport_200317_2

mariuszkrzaczkowski commented 4 years ago

did you check on the development version?

vovpff commented 4 years ago

@mariuszkrzaczkowski i can't repeat this conditions. Invisible record was added in 2016-2017 when I migrated from vtiger.

I tried to add new filter without conditions. This is not filter problem.

If I replace creator in db to other user - no reaction too.

I will try to check system log today.

vovpff commented 4 years ago

@mariuszkrzaczkowski where I can send system log related to this issue?

mariuszkrzaczkowski commented 4 years ago

github@yetiforce.com

mariuszkrzaczkowski commented 4 years ago

send this line from vtiger_crmentity and logs from ListViewEntries_logs.txt image

vovpff commented 4 years ago

@mariuszkrzaczkowski I has been put line

        file_put_contents('ListViewEntries_logs.txt', print_r($query->createCommand()->getRawSql(), true), FILE_APPEND);

into ListView.php but log file doesn't appear

What is wrong?

mariuszkrzaczkowski commented 4 years ago

try this

file_put_contents(ROOT_DIRECTORY . 'ListViewEntries_logs.txt', print_r($query->createCommand()->getRawSql(), true), FILE_APPEND);
vovpff commented 4 years ago

@mariuszkrzaczkowski

SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE `vtiger_crmentity`.`deleted`=0 ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31 OFFSET 420
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31 OFFSET 420
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND (`u_yf_igdn`.`subject` LIKE '%Gaiser НЦ ПЭ%') AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND (`u_yf_igdn`.`igdn_status` IN ('PLL_DRAFT', 'PLL_IN_REALIZATION', 'PLL_FOR_APPROVAL', 'PLL_OBJECTIONS')) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND (`u_yf_igdn`.`subject` LIKE '%###%') AND (`u_yf_igdn`.`igdn_status` IN ('PLL_DRAFT', 'PLL_IN_REALIZATION', 'PLL_FOR_APPROVAL', 'PLL_OBJECTIONS')) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND (`u_yf_igdn`.`subject` LIKE '%НИИВП%') AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND (`u_yf_igdn`.`subject` LIKE '%НИИВП%') AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) ORDER BY `vtiger_crmentity`.`modifiedtime` DESC LIMIT 31
SELECT `u_yf_igdn`.`igdnid` AS `id`, `u_yf_igdn`.`subject` AS `subject`, `u_yf_igdn`.`accountid` AS `accountid`, `u_yf_igdn`.`igdn_status` AS `igdn_status`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id`, `vtiger_crmentity`.`description` AS `description`, `vtiger_crmentity`.`attention` AS `attention`, `u_yf_igdn`.`etgdnrelvend` AS `etgdnrelvend`, `vtiger_crmentity`.`createdtime` AS `createdtime` FROM `u_yf_igdn` INNER JOIN `vtiger_crmentity` ON u_yf_igdn.igdnid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) LIMIT 31
SELECT `vtiger_account`.`accountid` AS `id`, `vtiger_account`.`accountname` AS `accountname`, `vtiger_account`.`website` AS `website`, `vtiger_account`.`phone` AS `phone`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id` FROM `vtiger_account` INNER JOIN `vtiger_crmentity` ON vtiger_account.accountid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) LIMIT 31
SELECT `vtiger_account`.`accountid` AS `id`, `vtiger_account`.`accountname` AS `accountname`, `vtiger_account`.`website` AS `website`, `vtiger_account`.`phone` AS `phone`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id` FROM `vtiger_account` INNER JOIN `vtiger_crmentity` ON vtiger_account.accountid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND (`vtiger_account`.`accountname` LIKE '%Π•Π²Ρ€ΠΎΠΈΠ½Ρ‚Π΅Ρ…%') AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) LIMIT 31

Request from Products module absolutely ignored...

vovpff commented 4 years ago

@mariuszkrzaczkowski this string

SELECT `vtiger_account`.`accountid` AS `id`, `vtiger_account`.`accountname` AS `accountname`, `vtiger_account`.`website` AS `website`, `vtiger_account`.`phone` AS `phone`, `vtiger_crmentity`.`smownerid` AS `assigned_user_id` FROM `vtiger_account` INNER JOIN `vtiger_crmentity` ON vtiger_account.accountid = vtiger_crmentity.crmid WHERE (`vtiger_crmentity`.`deleted`=0) AND (`vtiger_account`.`accountname` LIKE '%Π•Π²Ρ€ΠΎΠΈΠ½Ρ‚Π΅Ρ…%') AND ((`vtiger_crmentity`.`private`=0) OR ((`vtiger_crmentity`.`private`=1) AND ((`vtiger_crmentity`.`smownerid`=5) OR (`vtiger_crmentity`.`crmid` IN (SELECT DISTINCT `crmid` FROM `u_yf_crmentity_showners` WHERE `userid` IN (5, 2, 22, 23)))))) LIMIT 31

Gives empty list for user id 5 and one record for user id 1

crmid 937 is account with name Π•Π²Ρ€ΠΎΠΈΠ½Ρ‚Π΅Ρ…

mysql> SELECT * FROM `vtiger_account` WHERE `accountid` = 937;
+-----------+------------+-----------------------------+----------+--------------+----------+---------------+-----------+---------+-------+------------+---------------------+--------+---------------+------+-----------+-------------+---------------------+------------+-----------------------+-----------------------+--------------+-------------+------------+-----------------+--------------------+----------+------------------+----------+-------------+----------+----------+-------------------+-----------------+-------------+-----------+------------------+-------------+-----------------+--------------+--------------------+-----------------+-------+--------------------------+
| accountid | account_no | accountname                 | parentid | account_type | industry | annualrevenue | ownership | siccode | phone | otherphone | email1              | email2 | website       | fax  | employees | emailoptout | isconvertedfromlead | vat_id     | registration_number_1 | registration_number_2 | verification | no_approval | balance    | payment_balance | legal_form         | sum_time | inventorybalance | discount | creditlimit | products | services | last_invoice_date | accounts_status | phone_extra | fax_extra | otherphone_extra | etaccshname | etaccenname     | pricebook_id | check_stock_levels | sum_open_orders | taxes | accounts_available_taxes |
+-----------+------------+-----------------------------+----------+--------------+----------+---------------+-----------+---------+-------+------------+---------------------+--------+---------------+------+-----------+-------------+---------------------+------------+-----------------------+-----------------------+--------------+-------------+------------+-----------------+--------------------+----------+------------------+----------+-------------+----------+----------+-------------------+-----------------+-------------+-----------+------------------+-------------+-----------------+--------------+--------------------+-----------------+-------+--------------------------+
|       937 | O1         | ООО "Π•Π²Ρ€ΠΎΠΈΠ½Ρ‚Π΅Ρ…"             |        0 |              |          |    0.00000000 |           |         |       |            | 11 |        | 111 |      |         0 |           0 |                   0 | 7723633858 |                       |                       | NULL         |           0 | 0.00000000 |      0.00000000 | PLL_NATURAL_PERSON |     0.00 |       0.00000000 |     0.00 |           0 |          |          | NULL              | NULL            | NULL        | NULL      | NULL             |             | Eurointech Ltd. |         NULL |               NULL |            NULL | NULL  | NULL                     |
+-----------+------------+-----------------------------+----------+--------------+----------+---------------+-----------+---------+-------+------------+---------------------+--------+---------------+------+-----------+-------------+---------------------+------------+-----------------------+-----------------------+--------------+-------------+------------+-----------------+--------------------+----------+------------------+----------+-------------+----------+----------+-------------------+-----------------+-------------+-----------+------------------+-------------+-----------------+--------------+--------------------+-----------------+-------+--------------------------+
1 row in set (0.00 sec)
mysql> SELECT * FROM `vtiger_crmentity` WHERE `crmid` = 937;
+-------+-------------+-----------+-----------+------------+----------+-------------+-----------+---------------------+---------------------+------------+--------+---------+----------+---------+----------+---------+---------------------------------------------------------------------------+
| crmid | smcreatorid | smownerid | shownerid | modifiedby | setype   | description | attention | createdtime         | modifiedtime        | viewedtime | status | version | presence | deleted | was_read | private | users                                                                     |
+-------+-------------+-----------+-----------+------------+----------+-------------+-----------+---------------------+---------------------+------------+--------+---------+----------+---------+----------+---------+---------------------------------------------------------------------------+
|   937 |           1 |         5 |      NULL |          5 | Accounts |             |           | 2017-05-17 14:00:30 | 2019-11-12 15:45:32 | NULL       | NULL   |       0 |        1 |       0 |        0 |    NULL | ,1,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32, |
+-------+-------------+-----------+-----------+------------+----------+-------------+-----------+---------------------+---------------------+------------+--------+---------+----------+---------+----------+---------+---------------------------------------------------------------------------+
1 row in set (0.00 sec)
vovpff commented 4 years ago

@mariuszkrzaczkowski any ideas?

mariuszkrzaczkowski commented 4 years ago

show create table query

mariuszkrzaczkowski commented 4 years ago

remove condition from query and how many results do you have? vtiger_account.accountname LIKE '%Π•Π²Ρ€ΠΎΠΈΠ½Ρ‚Π΅Ρ…%'

vovpff commented 4 years ago

@mariuszkrzaczkowski i will prepare this data tomorrow morning

vovpff commented 4 years ago

@mariuszkrzaczkowski

without vtiger_account.accountname LIKE '%Π•Π²Ρ€ΠΎΠΈΠ½Ρ‚Π΅Ρ…%'

for vov

112 rows in set (0.00 sec)

for admin

293 rows in set (0.00 sec)

SHOW CREATE TABLE

For Accounts

mysql> SHOW CREATE TABLE `vtiger_account`
    -> ;
+----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table          | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
+----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| vtiger_account | CREATE TABLE `vtiger_account` (
  `accountid` int(10) NOT NULL DEFAULT '0',
  `account_no` varchar(100) NOT NULL,
  `accountname` varchar(255) NOT NULL,
  `parentid` int(10) DEFAULT '0',
  `account_type` varchar(200) DEFAULT NULL,
  `industry` varchar(200) DEFAULT NULL,
  `annualrevenue` decimal(28,8) DEFAULT NULL,
  `ownership` varchar(50) DEFAULT NULL,
  `siccode` varchar(255) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `otherphone` varchar(30) DEFAULT NULL,
  `email1` varchar(100) DEFAULT NULL,
  `email2` varchar(100) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `fax` varchar(30) DEFAULT NULL,
  `employees` int(10) DEFAULT '0',
  `emailoptout` smallint(1) DEFAULT '0',
  `isconvertedfromlead` smallint(3) DEFAULT '0',
  `vat_id` varchar(30) DEFAULT NULL,
  `registration_number_1` varchar(30) DEFAULT NULL,
  `registration_number_2` varchar(30) DEFAULT NULL,
  `verification` text,
  `no_approval` smallint(1) DEFAULT '0',
  `balance` decimal(28,8) DEFAULT NULL,
  `payment_balance` decimal(25,8) DEFAULT NULL,
  `legal_form` varchar(255) DEFAULT NULL,
  `sum_time` decimal(10,2) DEFAULT NULL,
  `inventorybalance` decimal(25,8) DEFAULT '0.00000000',
  `discount` decimal(5,2) DEFAULT '0.00',
  `creditlimit` int(10) DEFAULT NULL,
  `products` text,
  `services` text,
  `last_invoice_date` date DEFAULT NULL,
  `accounts_status` varchar(255) DEFAULT NULL,
  `phone_extra` varchar(100) DEFAULT NULL,
  `fax_extra` varchar(100) DEFAULT NULL,
  `otherphone_extra` varchar(100) DEFAULT NULL,
  `etaccshname` varchar(60) DEFAULT '',
  `etaccenname` varchar(200) DEFAULT '',
  `pricebook_id` int(10) DEFAULT NULL,
  `check_stock_levels` tinyint(1) DEFAULT NULL,
  `sum_open_orders` decimal(28,8) DEFAULT NULL,
  `taxes` text,
  `accounts_available_taxes` text,
  PRIMARY KEY (`accountid`),
  KEY `account_account_type_idx` (`account_type`),
  KEY `email_idx` (`email1`,`email2`),
  KEY `accountname` (`accountname`),
  KEY `parentid` (`parentid`),
  KEY `vtiger_account_pricebook_id_idx` (`pricebook_id`),
  CONSTRAINT `fk_1_vtiger_account` FOREIGN KEY (`accountid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

For Products

mysql> SHOW CREATE TABLE `vtiger_products`;
+-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table           | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
+-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| vtiger_products | CREATE TABLE `vtiger_products` (
  `productid` int(10) NOT NULL,
  `product_no` varchar(100) NOT NULL,
  `productname` varchar(100) DEFAULT NULL,
  `productcode` varchar(40) DEFAULT NULL,
  `pscategory` varchar(200) DEFAULT NULL,
  `manufacturer` varchar(200) DEFAULT NULL,
  `qty_per_unit` decimal(11,2) DEFAULT '0.00',
  `unit_price` text,
  `weight` decimal(11,3) DEFAULT NULL,
  `pack_size` int(10) DEFAULT NULL,
  `sales_start_date` date DEFAULT NULL,
  `sales_end_date` date DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `cost_factor` int(10) DEFAULT NULL,
  `commissionrate` decimal(8,3) DEFAULT NULL,
  `commissionmethod` varchar(50) DEFAULT NULL,
  `discontinued` tinyint(1) NOT NULL DEFAULT '0',
  `usageunit` varchar(200) DEFAULT NULL,
  `reorderlevel` int(10) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `mfr_part_no` varchar(200) DEFAULT NULL,
  `vendor_part_no` varchar(200) DEFAULT NULL,
  `serialno` varchar(200) DEFAULT NULL,
  `qtyinstock` decimal(25,3) DEFAULT NULL,
  `productsheet` varchar(200) DEFAULT NULL,
  `qtyindemand` int(10) DEFAULT NULL,
  `glacct` varchar(200) DEFAULT NULL,
  `vendor_id` int(10) DEFAULT NULL,
  `imagename` text,
  `taxes` varchar(50) DEFAULT NULL,
  `ean` varchar(30) DEFAULT NULL,
  `subunit` varchar(255) DEFAULT '',
  `renewable` tinyint(1) DEFAULT '0',
  `category_multipicklist` text,
  `etprodorigname` varchar(255) DEFAULT '',
  `etprodcustplname` varchar(255) DEFAULT '',
  `etprodbookkeepname` text,
  `etprodadminnotes` text,
  `etprodkitcontent` text,
  `etprodsalesterms` varchar(255) DEFAULT '',
  `etprodstock` varchar(50) DEFAULT '',
  `etproddescr` text,
  `etprodrefresh` tinyint(1) DEFAULT '0',
  `etprodstor` varchar(30) DEFAULT '',
  `etprodbkcat` varchar(30) DEFAULT '',
  `etprodid` varchar(255) DEFAULT '',
  `vqtyqty` bigint(15) DEFAULT '0',
  `vqtygdn` bigint(15) DEFAULT '0',
  `vqtygrn` bigint(15) DEFAULT '0',
  `vqtypre` bigint(15) DEFAULT '0',
  `vqtyarr` bigint(15) DEFAULT '0',
  `vqtyall` varchar(100) DEFAULT '',
  `vqtyallw` text,
  `etprpo` text,
  `purchase` text,
  PRIMARY KEY (`productid`),
  CONSTRAINT `fk_1_vtiger_products` FOREIGN KEY (`productid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-----------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mariuszkrzaczkowski commented 4 years ago

have you tried to disable the private field mechanism? https://github.com/YetiForceCompany/YetiForceCRM/blob/298882dc280967fc2a34ffe0f07ed04284e282cd/config/Security.php#L50-L51

vovpff commented 4 years ago

@mariuszkrzaczkowski no. I newer touched this config parameter in the past.

I found cause of problem. Old records what was added to fresh system by migration tool at ver. 2.x was imported without private absolutely because this feature was unavailable at that time. I found 1800 rows in vtiger_crmentity with NULL private column.

Query after solves this problem. I noticed a lot of my problems caused by NULL in database. Many many thanks for your support and time.

UPDATE `vtiger_crmentity` SET `private` = '0' WHERE `private` IS NULL

Also I has question: why this code does not react on searching in Product module? What is wrong?

file_put_contents(ROOT_DIRECTORY . 'ListViewEntries_logs.txt', print_r($query->createCommand()->getRawSql(), true), FILE_APPEND);
mariuszkrzaczkowski commented 4 years ago

because they have their own file https://github.com/YetiForceCompany/YetiForceCRM/blob/developer/modules/Products/models/ListView.php#L55

vovpff commented 4 years ago

@mariuszkrzaczkowski thanks for info!