Answers.Body: <p>That changed as part of civigrant changes in 5.47. <a href="https://github.com/civicrm/civicrm-core/commit/adde8f5eb1443a5048e5bf01dcb3fb7035fe557c#diff-b48ef419b5be8483fd4f9d6eaba0a30e7ae575001b25d554bef4331724518699R32" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/commit/adde8f5eb1443a5048e5bf01dcb3fb7035fe557c#diff-b48ef419b5be8483fd4f9d6eaba0a30e7ae575001b25d554bef4331724518699R32</a></p>
  <p>Just put the word static in front of line 270, i.e.</p>
  <p><code>public static function from</code>...</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-08T20:43:43.210Z
Answers.Text: and open an issue / PR on civibooking?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-08T19:59:55.997Z
Answers.LastActivityDate: 2022-06-08T19:59:55.997Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>We have been using <a href="https://github.com/pradpnayak/civibooking" rel="nofollow noreferrer">forked repo</a>, it has fatal error fixes.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-09T12:55:16.077Z
Answers.Text: Thank you, thank you Demerit and Pradeep. So grateful for your time to respond.
Answers.UserDisplayName: lkwetter
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-09T08:22:47.200Z
Answers.LastActivityDate: 2022-06-09T08:22:47.200Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I'm running Drupal 7.9, CiviCRM 5.50.1 and php 7.4 and am getting this error with CiviBooking:</p>
  <pre><code>Fatal error: Cannot make static method CRM_Contact_BAO_Query_Interface::from() non static in class CRM_Booking_BAO_Query in /home/mysite/www/www/sites/default/files/civicrm/civi_extensions/uk.co.compucorp.civicrm.booking/CRM/Booking/BAO/Query.php on line 270
  </code></pre>
  <p>I am not a PHP guru. Can someone explain what is wrong? And maybe a bit on how I might fix it?</p>
  <p>The code starting at line 270 is:</p>
  <pre><code>function from($name, $mode, $side) {
      $from = NULL;
      switch ($name) {
        case 'civicrm_booking':
          $from = &quot; $side JOIN civicrm_booking ON civicrm_booking.primary_contact_id = contact_a.id AND civicrm_booking.is_deleted = 0 &quot;;
          break;
        case 'civicrm_booking_status':
          $from = &quot; $side JOIN civicrm_option_group option_group_booking_status ON (option_group_booking_status.name = 'booking_status') &quot;;
          $from .= &quot; $side JOIN civicrm_option_value civicrm_booking_status ON (civicrm_booking.status_id = civicrm_booking_status.value AND option_group_booking_status.id = civicrm_booking_status.option_group_id ) &quot;;
          break;
        case 'civicrm_booking_payment_status':
          $from .= &quot; $side JOIN civicrm_booking_payment on civicrm_booking_payment.booking_id = civicrm_booking.id &quot;;
          $from .= &quot; $side JOIN civicrm_contribution contribution on contribution.id = civicrm_booking_payment.contribution_id &quot;;
          $from .= &quot; $side JOIN civicrm_option_group option_group_booking_payment ON option_group_booking_payment.name = 'contribution_status' &quot;;
          $from .= &quot; $side JOIN civicrm_option_value civicrm_booking_payment_status ON (contribution.contribution_status_id = civicrm_booking_payment_status.value AND option_group_booking_payment.id = civicrm_booking_payment_status.option_group_id ) &quot;;
          break;
        case 'civicrm_booking_associated_contact':
          $from = &quot; $side JOIN civicrm_contact civicrm_booking_associated_contact ON (civicrm_booking_associated_contact.id = civicrm_booking.secondary_contact_id) &quot;;
          break;
      }
      return $from;
    }
  </code></pre>
  
Tags: <civibooking>
Title: civibooking fatal error -- need suggestions
ThreadText: # civibooking fatal error -- need suggestions
  
  (Asked by: username_0 on 2022-06-08)
  
  I'm running Drupal 7.9, CiviCRM 5.50.1 and php 7.4 and am getting this error with CiviBooking:
  Fatal error: Cannot make static method CRM_Contact_BAO_Query_Interface::from() non static in class CRM_Booking_BAO_Query in /home/mysite/www/www/sites/default/files/civicrm/civi_extensions/uk.co.compucorp.civicrm.booking/CRM/Booking/BAO/Query.php on line 270
  
  I am not a PHP guru. Can someone explain what is wrong? And maybe a bit on how I might fix it?
  The code starting at line 270 is:
  function from($name, $mode, $side) {
      $from = NULL;
      switch ($name) {
        case 'civicrm_booking':
          $from = " $side JOIN civicrm_booking ON civicrm_booking.primary_contact_id = contact_a.id AND civicrm_booking.is_deleted = 0 ";
          break;
        case 'civicrm_booking_status':
          $from = " $side JOIN civicrm_option_group option_group_booking_status ON (option_group_booking_status.name = 'booking_status') ";
          $from .= " $side JOIN civicrm_option_value civicrm_booking_status ON (civicrm_booking.status_id = civicrm_booking_status.value AND option_group_booking_status.id = civicrm_booking_status.option_group_id ) ";
          break;
        case 'civicrm_booking_payment_status':
          $from .= " $side JOIN civicrm_booking_payment on civicrm_booking_payment.booking_id = civicrm_booking.id ";
          $from .= " $side JOIN civicrm_contribution contribution on contribution.id = civicrm_booking_payment.contribution_id ";
          $from .= " $side JOIN civicrm_option_group option_group_booking_payment ON option_group_booking_payment.name = 'contribution_status' ";
          $from .= " $side JOIN civicrm_option_value civicrm_booking_payment_status ON (contribution.contribution_status_id = civicrm_booking_payment_status.value AND option_group_booking_payment.id = civicrm_booking_payment_status.option_group_id ) ";
          break;
        case 'civicrm_booking_associated_contact':
          $from = " $side JOIN civicrm_contact civicrm_booking_associated_contact ON (civicrm_booking_associated_contact.id = civicrm_booking.secondary_contact_id) ";
          break;
      }
      return $from;
    }
  
  **Tags:** civibooking
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-06-08. Score: 2
  
  That changed as part of civigrant changes in 5.47. <https://github.com/civicrm/civicrm-core/commit/adde8f5eb1443a5048e5bf01dcb3fb7035fe557c#diff-b48ef419b5be8483fd4f9d6eaba0a30e7ae575001b25d554bef4331724518699R32>
  
  Just put the word static in front of line 270, i.e.
  
  `public static function from`...
  
  > **Comments:**
  > **username_2**: and open an issue / PR on civibooking?  
  
  ---
  
  ### Answer by username_3 on 2022-06-09. Score: 1
  
  We have been using [forked repo](https://github.com/pradpnayak/civibooking), it has fatal error fixes.
  
  > **Comments:**
  > **username_0**: Thank you, thank you username_1 and Pradeep. So grateful for your time to respond.  
  
  ---
  
  