Fix Undefined array key social_networks in vartheme_bs5_preprocess_login_with()

Created on 18 June 2025, 17 days ago

Problem/Motivation

The login page shows PHP warnings related to Undefined array key "social_networks" in vartheme_bs5_preprocess_login_with(). In addition, the expected social network icons (Facebook, Google, etc.) do not load, and foreach() fails because the expected array is null.

Steps to reproduce

  1. Enable one or more Social Auth modules (e.g., Social Auth Google, Facebook) and disable the Gin Login module.
  2. Visit the login page (/user/login) after enabling social login.
  3. Observe: PHP warning about Undefined array key "social_networks" and social network icons do not appear.

Proposed resolution

  • Update the vartheme_bs5_preprocess_login_with() function to use $variables['networks'] instead of social_networks, as per Social API changes.
  • Check if the array is set and iterable before looping.
  • Provide a custom image path to render on UI.
  • Update the Twig template login-with.html.twig to use $variables['networks'] instead of social_networks, and fallback to the custom image path if exist.

Remaining tasks

  • ✅ File an issue about this project
  • ❌ Addition/Change/Update/Fix to this project
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Code review from 1 Varbase core team member
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes and Update Helper on new feature change/addition
  • ❌ Release

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A
🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇯🇴Jordan n.ghunaim Amman - Jordan

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