*

Omar Sherif

  • **
  • 5 posts
Bug in the list of alerts a user is subscribed too
« on: March 04, 2022, 03:33:24 PM »
When a user is logged in and goes to My Account -> Alerts , he/she is supposed to see the items that are in the same categories of the alerts he subscribed to previously, the bug is that if one of these items to be displayed is created from the admin panel as opposed to another using creating it, and hence in the database this item has no associated user 'oc_t_item.fk_i_user_id = NULL' this 1 item gets displayed 12 times and no other items get displayed.

To recreate this you can
1-go the demo osclass website
2-login to the demo account
3-just press the search button
4-after you get the search results subscribe to this search
5-go to My Account->Alerts

you should see something like what's linked in the attachment.

Another question the limit in this page is only 12 items and it's not paginated so you only get the most recent 12 items. is this on purpose?

When I logged the queries I believe the query that does this is

FROM ( oc_t_user , oc_t_item)
LEFT OUTER JOIN oc_t_item_delta ON oc_t_item.pk_i_id = oc_t_item_delta.fk_i_item_id
WHERE ((oc_t_user.pk_i_id = oc_t_item.fk_i_user_id AND oc_t_item.fk_i_user_id != 9) || oc_t_item.fk_i_user_id IS NULL)
AND oc_t_item.b_enabled = 1 AND oc_t_item.b_active = 1 AND oc_t_item.b_spam = 0 AND (oc_t_item.b_premium = 1 || oc_t_item.dt_expiration >= '2022-03-03 14:44:03')
AND oc_t_item.fk_i_category_id IN (99)
ORDER BY dt_pub_date desc
LIMIT 0, 12

this from my setup so changes apply but this is the query that gets this list and I believe it's constructed using the DAO in oc-includes/osclass/model/Search.php

Any help appreciated.








*

MB Themes

Re: Bug in the list of alerts a user is subscribed too
« Reply #1 on: March 04, 2022, 05:06:56 PM »
Query looks ok to me, you can try to run it on database to see results as well, but maybe I am missing something.
In alerts you will see just 12 listings, to see all you should go to search page but I would say this is not yet properly handled by osclass (i.e. to get how many other items is there except those 12), also notification frequency changer is missing for me...
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Omar Sherif

  • **
  • 5 posts
Re: Bug in the list of alerts a user is subscribed too
« Reply #2 on: March 11, 2022, 11:36:23 AM »
It works fine if there is a user associated with the listing but if the user is NULL which is the case when the listing is created from the admin panel this problem occurs.

*

MB Themes

Re: Bug in the list of alerts a user is subscribed too
« Reply #3 on: March 11, 2022, 12:32:19 PM »
I do not see anything wrong with query
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Omar Sherif

  • **
  • 5 posts
Re: Bug in the list of alerts a user is subscribed too
« Reply #4 on: March 11, 2022, 03:23:21 PM »
Me neither but the behavior that is reproducible on the demo site does not seem correct to display the same item more than once, or am I missing something?

*

Omar Sherif

  • **
  • 5 posts
Re: Bug in the list of alerts a user is subscribed too
« Reply #5 on: March 11, 2022, 03:30:48 PM »
And I did try it in the database and it returns the same item 12 times. so maybe it is faulty somehow.

*

MB Themes

Re: Bug in the list of alerts a user is subscribed too
« Reply #6 on: March 11, 2022, 05:13:13 PM »
Send link and user you use on demo
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Omar Sherif

  • **
  • 5 posts
Re: Bug in the list of alerts a user is subscribed too
« Reply #7 on: March 12, 2022, 05:17:20 AM »
https://osclass-classifieds.com/demo and the default credentials

*

MB Themes

Re: Bug in the list of alerts a user is subscribed too
« Reply #8 on: March 16, 2022, 12:11:08 PM »
@Omar
Thanks for feedback, we were able to reproduce and fix the issue.
Fix will be available in 8.0.2.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots