Skip Navigation

[Resolved] Views 2.5.1 update created new error in OceanWP MegaMenu

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 1.28 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 10 replies, has 3 voices.

Last updated by Christian Cox 6 years ago.

Assisted by: Christian Cox.

Author
Posts
#591257
menuerror.jpg

OK, this is not an immediate need for help as I have come up with a workaround, but hopefully you will agree that it still needs fixing. I'm going to try and fully describe what I found, so here goes:

I'm using the OceanWP theme and displaying a Posts View in a my main menu by using the themes ability to show a widget area as a MegaMenu. Basically, I dropped a WP Views widget into a custom widget area, then added that widget area to my menu. You can see this at hidden link by hovering over the "What's New?" menu item. It is the list on the right.

It was working great until I applied the 2.5.1 Views update, then I began getting this error above the list, repeated once for every post item returned by the view:

Warning: Missing argument 2 for OE_Menu_Icons_Front_End::_add_icon() in /home/sbvfdtx/public_html/wp-content/plugins/ocean-extra/includes/menu-icons/includes/front.php on line 156

I included a screenshot of the problem with this ticket.

I changed various things about the view, deleted and re-created the view, the widget area, the menu, etc., all to no avail. I eventually discovered that any POSTS view I created (no matter how simple) did the same thing, but USER views did not have the problem. But obviously I need this specific posts view to work, so I dug deeper.

I tried replacing the WP Views widget with a basic HTML widget containing the view shortcode, with no immediate luck. Then I began to suspect that since I essentially get two "items" (the error message and the correct rendering) for each post returned, maybe the issue is related to the query portion of the view. In the Filter and Loop Output Integration Editor of the view, I added hide="true" as follows:

[wpv-filter-meta-html hide="true"]

This worked - as long as I leave the HTML widget in my menu. If I revert to the WP Views widget, the error returns (even with the hide="true" statement).

So, I have the site functioning correctly for now, but still would appreciate a resolution so that I can use the full functionality of my Views plugin without workarounds. Sorry to be so long-winded, but I'm hoping that my tinkering will help point you more directly to the source of the issue and help with a fix.

Thanks!

Don

#591377

Hi, I see what you're describing, and I'm able to replicate it on my own local environment. Like you said, if I downgrade to Views 2.5 the issue isn't there. I tried several different approaches with mixed results. I copied the actual HTML generated by the View and pasted it into a Custom HTML widget instead of using a Views shortcode or a WP View widget, and this resulted in no errors shown. I used the raw text output options, but those didn't help either. I tested other Views shortcodes like [wpv-post-id] in the custom HTML widget, and it seemed to work just fine. So there seems to be a compatibility issue here. I'm escalating this issue to our 2nd tier support team for additional investigation. I will let you know as soon as I have an update.

#591380

Christian,

Thanks for the quick response, and glad to hear that you are seeing the same thing that I did. As we both discovered, it's not an emergency because there are effective workarounds, but it would be nice to get it fixed anyway.

Don

#591759

We've found a minor adjustment that seems to resolve this issue, and we are hoping you can confirm. Change line 156 in : /plugins/ocean-extra/includes/menu-icons/includes/front.php
From:

public static function _add_icon( $title, $id ) {

To:

public static function _add_icon( $title, $id=null ) {

This will provide a fallback value for the 2nd parameter in all cases. If this works for you, we may recommend this to the plugin author as a possible solution.

#591869

Christian,

Actually, I thought about this late yesterday and had already tried it. I'm sure that it won't come as a surprise, but I can confirm that it does resolve the error on my site as well. However I also think that you will agree that editing base code for a plugin is not a viable solution, so I will continue to use my original workaround for now, and still would like to see a permanent fix.

I do have to say that - from a customer perspective - the "problem" would seem to be yours. Everything worked fine with the latest version of Ocean Extra right up until the Views 2.5.1 update, so obviously something in that update broke it. It also does not seem that a parameter should have to be nulled to prevent someone failing to call the function correctly.

Anyway, I understand the complexities that must be associated with trying to make all the various WordPress plugins play well together. I've always found Toolset to be a great product, and I'm also becoming quite a fan of OceanWP, so I'm sure that if you both work on it a solution will be forthcoming. Whatever it is, i hope to stay a happy user of both products for a long time!

Please keep me posted.

Don

#592156

Thanks, I will pass that information along to the team so they can coordinate with the OceanWP authors. I'll let you know as collaboration progresses, and hopefully we can come up with a permanent solution very soon.

#597984

Today I encountered this error and what I realized that OceanWP Theme displays this warning if there is no menu created under WordPress default navigation. After creating at least 1 menu it disappears.

Interestingly it has nothing to do with the toolset.

#600659

Hi krishnaT!

I was very intrigued by your post and would love to find a simple way to fix this problem. I'm afraid that I'm confused about what you mean by "no menu created under WordPress default navigation". I have several menus that were all created via the normal Appearance > Menus function on the back end. When you say "After creating at least 1 menu it disappears" where and how do you mean that I should create this menu?

I would really appreciate any further information you could provide.

Thanks!

#605611

Hi,
I know it has been some time since this thread was started, but I am still looking for a final resolution. The wpv-filter-meta-html hide="true" fix I mentioned in the OP no longer works consistently for some reason. I implemented the workaround suggested by Christian, which involves editing the OceanWP front.php theme file directly . I have had to re-create that fix several times now due to updates to that theme (no apparent way to do it in my child theme), and it is getting tiresome.

OceanWP tells me that it is a Toolset issue, but I'm not going to get in the middle of that; I would just like a permanent fix.

Thanks,
Don

#606064

Hi, this problem has been added to our compatibility issue queue, but we do not have a permanent fix available yet. I will keep you posted here as I get more information.

#1149247

Hi Don, do you have an updated version of the Ocean Mega Menu plugin we could use for additional testing? I have activated private reply fields here where you can share a download link.