Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-12703

Notification System sends exact same SQL query multiple times

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-b4
    • Fix Version/s: 3.1.2-RC1
    • Component/s: Notification System
    • Labels:
      None

      Description

      The following query is executed more than once on http://localhost/projects/phpbb3/phpBB/ucp.php?i=ucp_notifications&mode=notification_options

      SELECT group_id
      FROM phpbb_user_group
      WHERE user_id = 2
      AND group_leader = 1
      LIMIT 1
      

      Seems to be sent from ./phpbb/notification/type/group_request.php

        Activity

        Hide
        Senky Senky added a comment - - edited

        After a little more inspection, I found out that it is called twice from ucp_notifications.php:
        1. line 43

        $subscriptions = $phpbb_notifications->get_global_subscriptions(false);

        get_global_subscriptions() calls for a get_subscription_types() which makes the is_available() call.

        2. line 193

        foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types)

        direct call to get_subscription_types() which makes the is_available() call.

        Now the point is, that all notification types are tested for availability twice, but only group_request type uses SQL query to test so.

        This is the explanation. Now the question is, what to do with it?

        Show
        Senky Senky added a comment - - edited After a little more inspection, I found out that it is called twice from ucp_notifications.php: 1. line 43 $subscriptions = $phpbb_notifications->get_global_subscriptions(false); get_global_subscriptions() calls for a get_subscription_types() which makes the is_available() call. 2. line 193 foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types) direct call to get_subscription_types() which makes the is_available() call. Now the point is, that all notification types are tested for availability twice, but only group_request type uses SQL query to test so. This is the explanation. Now the question is, what to do with it?

          People

          • Assignee:
            Marc Marc
            Reporter:
            bantu Andreas Fischer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development