Error: Typed property Drupal\social_api\SocialApiDataHandler::$sessionPrefix must not be accessed before initialization in Drupal\social_api\SocialApiDataHandler->getSessionPrefix()

Created on 22 January 2025, 29 days ago

Problem/Motivation

We installed the Social Post Facebook module but encountered an error during configuration.

This issue occurred specifically while using the Social Post Facebook module.
Here is the related issue link:
https://www.drupal.org/project/social_post_facebook/issues/3498531 🐛 PHP Fatal error: Type of FacebookPostAuthManager::$client must be mixed, other declaration issues Active

To resolve the issue, we applied the provided patch, which fixed the original problem. However, after reloading the page for the Social API module, a new error occurred:

Error: Typed property Drupal\social_api\SocialApiDataHandler::$sessionPrefix must not be accessed before initialization in Drupal\social_api\SocialApiDataHandler->getSessionPrefix() (line 47 of modules\contrib\social_api\src\SocialApiDataHandler.php).

Steps to Reproduce

1: Install the Social Post Facebook module using Composer.
2: Enable the following modules in your environment:
Social API
Social Post
Social Post Facebook
3: Navigate to the configuration page for the Social Post Facebook module:
/admin/config/social-api/social-post/facebook/users.
The following error appears:

Fatal error: Type of Drupal\social_post_facebook\FacebookPostAuthManager::$client must be mixed (as in class Drupal\social_api\AuthManager\OAuth2Manager) in D:\laragon\www\drupal10\web\modules\contrib\social_post_facebook\src\FacebookPostAuthManager.php on line 13

Apply the patch available at:
https://www.drupal.org/files/issues/2025-01-09/3498531-social-post-faceb... .

Reload the page: /admin/config/social-api/social-post/facebook/users.
After applying the patch, the following error appears:

Error: Typed property Drupal\social_api\SocialApiDataHandler::$sessionPrefix must not be accessed before initialization in Drupal\social_api\SocialApiDataHandler->getSessionPrefix() (line 47 of modules\contrib\social_api\src\SocialApiDataHandler.php).

An image illustrating the actions taken is attached.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇮🇳India aman_lnwebworks

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024