================================================================================
WPML + BRICKS THEME INTEGRATION BUG REPORT & FIXES
Date: November 25, 2025
Site: amint.alpinet.ch
Bricks Theme Version: 2.1.4
WPML Version: 4.8.5
================================================================================
PROBLEM SUMMARY
The site experienced multiple critical errors preventing proper operation:
- Fatal Error: Missing WPML method
- Apache redirect loops (AH00124 errors)
- TypeError in WPML string translation
================================================================================
ISSUE #1: MISSING get_translated_component() METHOD
ERROR MESSAGE:
Fatal error: Uncaught Error: Call to undefined method
Bricks\Integrations\Wpml\Wpml::get_translated_component()
in wp-content/themes/bricks/includes/helpers.php:1108
CAUSE:
The Bricks theme helpers.php file (line 1108) calls
Wpml::get_translated_component() method, but this method was missing from
the WPML integration class in wp-content/themes/bricks/includes/integrations/wpml/wpml.php
This is a Bricks 2.1+ feature for translating components that wasnāt present
in the active theme files.
SOLUTION:
Added three missing methods to wpml.php:
- get_translated_component() - Main method to translate components on-the-fly
- get_translated_elements() - Helper to translate element settings
- get_translated_component_properties() - Helper to translate component properties
These methods allow WPML to translate Bricks components using the WPML
String Translation API.
FILE MODIFIED:
wp-content/themes/bricks/includes/integrations/wpml/wpml.php
(Added approximately 250 lines of code at the end of the class)
================================================================================
ISSUE #2: APACHE REDIRECT LOOPS (AH00124)
ERROR MESSAGE:
AH00124: Request exceeded the limit of 10 internal redirects due to probable
configuration error. Use āLimitInternalRecursionā to increase the limit if
necessary.
CAUSE:
The .htaccess file had hardcoded rewrite rules that only worked with the
/en/ directory:
- RewriteBase /en/
- RewriteRule . /en/index.php [L]
- Language-specific login redirects hardcoded
This configuration caused infinite redirect loops when accessing:
- French language pages (/fr/)
- Root URLs
- Admin pages with language parameters
SOLUTION:
Fixed .htaccess rewrite rules to properly support WPML multi-language setup:
- Changed RewriteBase from /en/ to /
- Changed final RewriteRule from /en/index.php to /index.php
- Removed hardcoded language-specific login redirects
FILE MODIFIED:
.htaccess (root directory)
BEFORE:
RewriteBase /en/
RewriteRule ^index\.php$ - [L]
RewriteRule ^en/wp-login.php /en/wp-login.php [QSA,L]
RewriteRule ^fr/wp-login.php /en/wp-login.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /en/index.php [L]
AFTER:
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
================================================================================
ISSUE #3: TYPEERROR IN WPML STRING TRANSLATION
ERROR MESSAGE:
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on
string in wp-content/themes/bricks/includes/integrations/wpml/wpml.php:631
CAUSE:
After user modifications to the WPML integration file, the code attempted to
access nested array keys without validating that intermediate values were
actually arrays. This occurred in the wpml_page_builder_string_translated()
method when processing repeater field translations.
The code tried to access:
$path = &$bricks_elements[$index][āsettingsā][$setting_key][$repeater_index][$repeater_key];
But $setting_key sometimes contained a string value instead of an array,
causing the TypeError.
SOLUTION:
Added comprehensive validation before accessing nested array keys:
- Check if the setting exists and is an array
- Check if the repeater item exists and is an array
- Check if the repeater field exists
- Only then proceed with translation
Also added similar validation to component property translations.
FILE MODIFIED:
wp-content/themes/bricks/includes/integrations/wpml/wpml.php
(Lines 622-642 and 649-675)
================================================================================
ADDITIONAL WARNINGS (NON-CRITICAL)
WARNING TYPE:
PHP Warning: file_exists(): open_basedir restriction in effect
DETAILS:
WPML String Translation tries to load ACF translation files that are outside
the allowed server paths (/var/www/vhosts/alpinet.ch/:/tmp/)
Files itās looking for:
- acf-field-groupāfr_FR.mo
- acf-field-groupāfr_FR.l10n.php
- acf-field-group-0-fr_FR.mo
STATUS: These are harmless warnings and do not break functionality. WPML is
simply checking for translation files that donāt exist in the expected locations.
RECOMMENDATION: Can be safely ignored, or suppress by adjusting the
open_basedir PHP configuration if desired.
================================================================================
TECHNICAL DETAILS FOR DEVELOPER
KEY CONCEPTS:
- Bricks 2.1+ introduced component translation support via WPML
- Components can have properties with default values that need translation
- WPML uses āString Packagesā to group translatable strings
- Each component gets its own package: ābricks-componentsā
WPML INTEGRATION METHODS ADDED:
- get_translated_component($component): Main translation method
- get_translated_elements($elements, $package): Translates element settings
- get_translated_component_properties($properties, $package): Translates properties
- register_components_string_packages($old_value, $value): Registers strings on save
- process_component_properties_defaults($properties, $package): Processes defaults
- declare_component_string_package_kind($active_kinds): Declares package type
HOW IT WORKS:
- When components are saved, strings are registered with WPML
- When components are loaded, translations are applied on-the-fly
- Translation lookup uses the WPML filter: āwpml_translate_stringā
- Package format: {kind:āBricks componentsā, name:component_id, title:component_name}
VALIDATION PATTERNS ADDED:
- Always check is_array() before accessing nested array keys
- Use isset() to verify intermediate keys exist
- Validate array structure before attempting to create references with &
================================================================================
FILES MODIFIED (COMPLETE LIST)
-
wp-content/themes/bricks/includes/integrations/wpml/wpml.php
- Added get_translated_component() method
- Added get_translated_elements() helper method
- Added get_translated_component_properties() helper method
- Added register_components_string_packages() method
- Added process_component_properties_defaults() method
- Added declare_component_string_package_kind() method
- Added validation checks for repeater field access
- Added validation checks for component property access
-
.htaccess (root directory)
- Fixed RewriteBase from /en/ to /
- Fixed final RewriteRule from /en/index.php to /index.php
- Removed hardcoded language-specific redirects
================================================================================
TESTING RECOMMENDATIONS
- Test both EN and FR language versions of the site
- Verify component translations work correctly
- Test WPML translation queue functionality
- Verify admin pages load without errors
- Check frontend pages in both languages
- Test wp-login.php access in both languages
- Verify no redirect loops occur
- Test ACF field groups (if used) with translations
================================================================================
FUTURE RECOMMENDATIONS
- Consider upgrading to latest Bricks theme version if available
- Keep WPML plugins updated to latest versions
- Monitor error logs for any new issues
- Consider adding unit tests for WPML integration
- Document any custom WPML configurations
================================================================================
REFERENCES
-
Bricks Theme WPML Integration:
https://academy.bricksbuilder.io/article/wpml/ -
WPML Page Builder Integration Documentation:
Integrating a page builder with WPML Ā· Wiki Ā· Glue Plugins / WPML / WPML Page Builders Ā· GitLab -
WPML String Package Documentation:
How to Create String Packages - WPML
================================================================================
CONTACT FOR QUESTIONS
If you need clarification on any of these fixes or encounter additional
issues related to this integration, please review:
- The specific code changes in the modified files
- WPML debug logs (if enabled)
- PHP error logs for additional context
- Bricks theme changelog for version 2.1.4
================================================================================
END OF REPORT