New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets error on WP v4.8.1 #273

Closed
mnajafzadeh opened this Issue Sep 1, 2017 · 13 comments

Comments

Projects
None yet
2 participants
@mnajafzadeh

mnajafzadeh commented Sep 1, 2017

Type of issue

  • Bug report.
  • Suggestion.

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate,
  • The issue still exists against the latest dev branch.
  • This is not a usage question (Those should be directed to the community).
  • I have attempted to find the simplest possible steps to reproduce the issue.

Steps to reproduce the issue (for Bug report)

After updating to WP v4.8.1, lots of themes have conflict problem with Admin Page Framework. An example error I get on the website when Admin Page Framework is initiated:
WARNING: ARRAY_MERGE(): ARGUMENT #2 IS NOT AN ARRAY IN (…)/WP-INCLUDES/DEFAULT-WIDGETS.PHP ON LINE 117

Expected behavior and actual behavior

Environment

Versions

  • Admin Page Framework version: 3.8.15
  • WordPress version: 4.8.1
  • PHP version: 5.6

Isolating the problem

  • This bug happens on the demo page.
  • The bug happens consistently across all tested browsers.
  • This bug happens with clean install (with the default theme and no plugin except the problematic one).
@michaeluno

This comment has been minimized.

Show comment
Hide comment
@michaeluno

michaeluno Sep 4, 2017

Owner

I cannot confirm it with the built-in default theme. Can you provide the steps to reproduce the problem? An example theme that causes the error would be nice.

Owner

michaeluno commented Sep 4, 2017

I cannot confirm it with the built-in default theme. Can you provide the steps to reproduce the problem? An example theme that causes the error would be nice.

@mnajafzadeh

This comment has been minimized.

Show comment
Hide comment
@mnajafzadeh

mnajafzadeh Sep 5, 2017

Hi,

I think I found when this issue happens!
In fact, this problem happens when you add a "Custom HTML" widget into your widget areas.
I already added a Custom HTML into one of my theme widget areas and I get the error. I use the AVADA theme.

Thank you.

mnajafzadeh commented Sep 5, 2017

Hi,

I think I found when this issue happens!
In fact, this problem happens when you add a "Custom HTML" widget into your widget areas.
I already added a Custom HTML into one of my theme widget areas and I get the error. I use the AVADA theme.

Thank you.

@mnajafzadeh

This comment has been minimized.

Show comment
Hide comment
@mnajafzadeh

mnajafzadeh Sep 9, 2017

Any update?

mnajafzadeh commented Sep 9, 2017

Any update?

@michaeluno

This comment has been minimized.

Show comment
Hide comment
@michaeluno

michaeluno Sep 9, 2017

Owner

I said I cannot reproduce the problem. I've been waiting for you to provide the steps to reproduce it.

Owner

michaeluno commented Sep 9, 2017

I said I cannot reproduce the problem. I've been waiting for you to provide the steps to reproduce it.

@mnajafzadeh

This comment has been minimized.

Show comment
Hide comment
@mnajafzadeh

mnajafzadeh Sep 9, 2017

Sorry,

I already find the problem. The issue was not related to Admin Page Framework. It was my mistake in using the AdminPageFramework_Widget_Factory class.

Admin Page Framework is great!

Thank you.

mnajafzadeh commented Sep 9, 2017

Sorry,

I already find the problem. The issue was not related to Admin Page Framework. It was my mistake in using the AdminPageFramework_Widget_Factory class.

Admin Page Framework is great!

Thank you.

@mnajafzadeh mnajafzadeh closed this Sep 9, 2017

@mnajafzadeh

This comment has been minimized.

Show comment
Hide comment
@mnajafzadeh

mnajafzadeh Oct 20, 2017

Hi,

Sorry to open this issue again.
I get this error when I activate the "DesignThemes Core Features Plugin" on my WordPress:

( ! ) Warning: Missing argument 1 for AdminPageFramework_Widget::__construct(), called in D:\wamp\www\wordpress4\wp-content\plugins\designthemes-core-features\page-builder\pagebuilder.php on line 141 and defined in D:\wamp\www\wordpress4\wp-content\plugins\admin-page-framework\library\apf\factory\widget\AdminPageFramework_Widget.php on line 81

I checked the AdminPageFramework_Widget.php file and I set a default value for $sWidgetTitle and it fixed the problem but still get another error that is related to the rest of this function:

( ! ) Warning: Admin Page Framework: The method is not defined: get_field_name in D:\wamp\www\wordpress4\wp-content\plugins\admin-page-framework\library\apf\factory_common_abstract\AdminPageFramework_Factory.php on line 152

Thank you.

mnajafzadeh commented Oct 20, 2017

Hi,

Sorry to open this issue again.
I get this error when I activate the "DesignThemes Core Features Plugin" on my WordPress:

( ! ) Warning: Missing argument 1 for AdminPageFramework_Widget::__construct(), called in D:\wamp\www\wordpress4\wp-content\plugins\designthemes-core-features\page-builder\pagebuilder.php on line 141 and defined in D:\wamp\www\wordpress4\wp-content\plugins\admin-page-framework\library\apf\factory\widget\AdminPageFramework_Widget.php on line 81

I checked the AdminPageFramework_Widget.php file and I set a default value for $sWidgetTitle and it fixed the problem but still get another error that is related to the rest of this function:

( ! ) Warning: Admin Page Framework: The method is not defined: get_field_name in D:\wamp\www\wordpress4\wp-content\plugins\admin-page-framework\library\apf\factory_common_abstract\AdminPageFramework_Factory.php on line 152

Thank you.

@mnajafzadeh mnajafzadeh reopened this Oct 20, 2017

@michaeluno

This comment has been minimized.

Show comment
Hide comment
@michaeluno

michaeluno Oct 22, 2017

Owner

Hello,

You keep not providing the steps to reproduce the error. In addition, I don't have the files of the program you mentioned. If it is a free one, you should post a link.

It was my mistake in using the AdminPageFramework_Widget_Factory class.

Remove the class then.

Owner

michaeluno commented Oct 22, 2017

Hello,

You keep not providing the steps to reproduce the error. In addition, I don't have the files of the program you mentioned. If it is a free one, you should post a link.

It was my mistake in using the AdminPageFramework_Widget_Factory class.

Remove the class then.

@mnajafzadeh

This comment has been minimized.

Show comment
Hide comment
@mnajafzadeh

mnajafzadeh Oct 22, 2017

Here is the plugin file:

designthemes-core-features.zip

Simply install it along with Admin Page Framework on your WordPress and enable the Admin Page Framework demo.
I do not use "AdminPageFramework_Widget_Factory class" anymore. The problem occurs when I enable the Admin Page Framework demo.

Thank you.

mnajafzadeh commented Oct 22, 2017

Here is the plugin file:

designthemes-core-features.zip

Simply install it along with Admin Page Framework on your WordPress and enable the Admin Page Framework demo.
I do not use "AdminPageFramework_Widget_Factory class" anymore. The problem occurs when I enable the Admin Page Framework demo.

Thank you.

@michaeluno

This comment has been minimized.

Show comment
Hide comment
@michaeluno

michaeluno Oct 25, 2017

Owner

Does the problem only occur in WordPress v4.8? I checked their code and the problem should not be specific to v4.8 but it can occur in v4.7 or earlier.

Owner

michaeluno commented Oct 25, 2017

Does the problem only occur in WordPress v4.8? I checked their code and the problem should not be specific to v4.8 but it can occur in v4.7 or earlier.

@mnajafzadeh

This comment has been minimized.

Show comment
Hide comment
@mnajafzadeh

mnajafzadeh Oct 25, 2017

Hi,

I have checked on WordPress version 4.8.2 and have problem. I have not still checked on an earlier version but, it is not important as everyone always have WordPress updated.

Thank you.

mnajafzadeh commented Oct 25, 2017

Hi,

I have checked on WordPress version 4.8.2 and have problem. I have not still checked on an earlier version but, it is not important as everyone always have WordPress updated.

Thank you.

@michaeluno

This comment has been minimized.

Show comment
Hide comment
@michaeluno

michaeluno Oct 25, 2017

Owner

Hello,

If you want to solve your issue, it is incredibly important to report clearly what happens on which versions of the program as well as the steps to reproduce the problem. You initially addressed that the problem occurs after updating WordPress to 4.8.1.

Please try it on WordPerss v4.7 or earlier and see what happens.

Thank you.

Owner

michaeluno commented Oct 25, 2017

Hello,

If you want to solve your issue, it is incredibly important to report clearly what happens on which versions of the program as well as the steps to reproduce the problem. You initially addressed that the problem occurs after updating WordPress to 4.8.1.

Please try it on WordPerss v4.7 or earlier and see what happens.

Thank you.

@mnajafzadeh

This comment has been minimized.

Show comment
Hide comment
@mnajafzadeh

mnajafzadeh Dec 16, 2017

Hi,

No it is not related to WordPress update. It didn't also work on WP v4.7.0 or earlier. The problem is related to a bug in Admin Page Framework or DesignThemes Core Features plugin by DesignThemes.

The error message is saying "Missing argument 1 for AdminPageFramework_Widget::__construct()"!
The DesignThemes Core Features plugin calls all the widgets created in WordPress and the widgets that are created by Admin Page Framework are having a problem that throwing an error.

Best Regards.

mnajafzadeh commented Dec 16, 2017

Hi,

No it is not related to WordPress update. It didn't also work on WP v4.7.0 or earlier. The problem is related to a bug in Admin Page Framework or DesignThemes Core Features plugin by DesignThemes.

The error message is saying "Missing argument 1 for AdminPageFramework_Widget::__construct()"!
The DesignThemes Core Features plugin calls all the widgets created in WordPress and the widgets that are created by Admin Page Framework are having a problem that throwing an error.

Best Regards.

@michaeluno

This comment has been minimized.

Show comment
Hide comment
@michaeluno

michaeluno Jan 4, 2018

Owner

It is a conflict, not a bug. Admin Page Framework stores its original widget factory objects in the global $wp_widget_factory array and DesignThemes Core Features Plugin expects them to be of the class WP_Widget, which causes the error.

Specifically, in page-builder/pagebuilder.php (lines 139 to 141), there is

			foreach($wp_widget_factory->widgets as $class => $info){
			
				$widget = new $class();

By changing it to the following can avoid the error.

            foreach($wp_widget_factory->widgets as $class => $info){
			
                if ( ! is_subclass_of( $class, 'WP_Widget' ) ) {
                    continue;
                }
                $widget = new $class();
Owner

michaeluno commented Jan 4, 2018

It is a conflict, not a bug. Admin Page Framework stores its original widget factory objects in the global $wp_widget_factory array and DesignThemes Core Features Plugin expects them to be of the class WP_Widget, which causes the error.

Specifically, in page-builder/pagebuilder.php (lines 139 to 141), there is

			foreach($wp_widget_factory->widgets as $class => $info){
			
				$widget = new $class();

By changing it to the following can avoid the error.

            foreach($wp_widget_factory->widgets as $class => $info){
			
                if ( ! is_subclass_of( $class, 'WP_Widget' ) ) {
                    continue;
                }
                $widget = new $class();

@michaeluno michaeluno added the Conflicts label Jan 4, 2018

@michaeluno michaeluno added this to the 3.8.17 milestone Jul 7, 2018

@michaeluno michaeluno closed this in bf4b7fc Jul 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment