Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1471937

    I hope this message finds you well. I am reaching out regarding an issue I am encountering with the Enfold Builder after updating to PHP 8.2 and WordPress 6.7. While I understand that the support period for my license has expired, I wanted to share the details of the problem in case you can provide any guidance or a recommended course of action.

    Upon attempting to use the builder, it crashes with the following errors:

    Issue 1:

    File: class-template-builder.php
    Line: 2604
    Code:

    if (is_array($box) && isset($box['id']) && $box['id'] == $slug) {  
    

    Error Message:

    Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /code/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/php/class-template-builder.php:2604  
    

    Issue 2:

    File: class-meta-box.php
    Line: 172
    Code:

    if (isset($box['page']) && is_array($box['page'])) {  
        foreach ($box['page'] as $area) {  
    

    Given these errors, it seems the code may not be fully compatible with the newer PHP and WordPress versions. If an update is available or a patch could address this, I would greatly appreciate any assistance or direction you could provide.

    Thank you for taking the time to review this matter. I appreciate your help and understanding.

    Thank You

    Adeel Nazar

    #1471947

    Hey seemeconsulting,

    Which version of the theme are you running?

    Best regards,
    Rikard

    #1471957

    Theme Version is 6.0.6

    #1471997

    Hi,

    Please send us a temporary WordPress admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Best regards,
    Rikard

    #1472513
    This reply has been marked as private.
    #1472531

    Hi,

    Thanks for that. It looks like the default WordPress login URLs are not working, please share the login URL as well.

    Best regards,
    Rikard

    #1472575
    This reply has been marked as private.
    #1472591

    Hi,

    Thanks for that. What happens if you temporarily activate the parent theme, or deactivate all plugins?

    Best regards,
    Rikard

    #1472693

    After updating my PHP version from 7.3 to 8.2, I encountered a couple of issues with the theme due to type-related incompatibilities. These errors seem to arise from stricter type handling introduced in PHP 8.2 and primarily involve missing checks for variable types and proper initialization.

    Errors Encountered
    In class-template-builder.php at line 2604, within the apply_editor_wrap() method:

    Fatal Error:
    Fatal error: Uncaught TypeError: Cannot access offset of type string on string

    
    if( $box['id'] == $slug )
    

    Suggested Fix:

    
    if ( is_array( $box ) && isset( $box['id'] ) && $box['id'] == $slug )
    

    In class-meta-box.php:

    Fatal Error: Attempting to access an offset of type string on a string variable.

    Warnings: Trying to access array offsets on a boolean value.
    These issues occur due to uninitialized or improperly set variables. For example, the following line is problematic:

    
    if( in_array( $_POST['post_type'], $default_box['page'] ) )

    Suggested Fixes:

    
    if ( isset( $_POST['post_type'] ) && isset( $default_box['page'] ) && is_array( $default_box['page'] ) ) {
        				if ( in_array( sanitize_text_field( $_POST['post_type'] ), $default_box['page'] ) ) {
    						$must_check = true;
    					}
    				}
    

    These changes involve adding type checks and sanitizing inputs, ensuring compatibility with PHP 8.2 while maintaining the theme’s functionality. They are straightforward adjustments that enhance the theme’s robustness across PHP versions.

    If you’d like, I can share the exact code changes I made to resolve these issues. Could you kindly incorporate these fixes into the next update to ensure compatibility for all users?

    Thank you for your continued support, and please let me know if you need any additional details.

    #1472705

    Hi,

    Thank you for sharing this.

    I added it to core for next release 6.0.8.

    We highly appreciate your help.

    Best regards,
    Günter

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.