This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 10 replies, has 5 voices.

Last updated by Pieter 4 years, 9 months ago.

Assigned support staff: Amber Martin.

Author Posts
June 19, 2014 at 2:55 pm #421936

Pieter

The bug in question is:

Fatal error: Call to a member function is_attachment() on a non-object in /path/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line xxxx

line number depends on the version of WPML and is actually two lines. In WPML 3.1.5 the line numbers are 4788 and 4917

Can't provide a url as I'm on local dev.

Previously this issue has been reported in November 2013 (http://wpml.org/forums/topic/wpml-with-geo-mashup/). Miraculously the issue has been marked as Resolved, but what I gather from it, it is everything but.

Second time the issue was reported was in January this year (http://wpml.org/forums/topic/geo-mashup-and-wpml/) and it has been marked as Closed promising a follow up. It is unclear whether that follow up has been sent to the user or not...

In the first thread a few "solutions" are offered.
1. remove the offending code ($query->is_attachment()) from the file sitepress.class.php: you actually need to comment out the two pipe characters too for it to work.
Obviously this does not even come close to being a solution as this falls apart as soon as WPML gets updated. Not ideal for a site you own, impossible to do on a site of a client. Unfortunately it is the only solution that works...

2. remove everything related to WPML from a particular page.
Could perhaps work in theory, but I don't see this happening in a real life situation (maybe I'm wrong?).

3. Someone went through the effort of re-developing part of the sitepress.class.php file and added 2 other files into the equation. (linked to from first thread: hidden link)
Apart from quite bizar for what should be a simple solution, I cannot get this to work.

So 3rd time lucky: what is the solution to this irritating bug apart from removing the offending lines from the sitepress.class.php file myself?

Looking forward to a resolution!

June 19, 2014 at 6:14 pm #422033

Amber Martin

Hello,
I am checking with our developers. You are only receiving the error when both WPML and Geo Mashup are both activated correct? You are using 3.15?
Thanks,
Amber

June 20, 2014 at 12:38 am #422116

Pieter

Hi Amber,
Yes, the error only occurs when WPML is activated. Geo Mashup by itself works out of the box as advertised.
If you check the error, you can see that the sitepress.class.php is the culprit. As I explained above in WPML 3.1.5 on lines 4788 and 4917.
If I delete

|| $query->is_attachment()

from both those lines everything works.

I want to emphasise that this is an *existing* issue that the developers are well aware of. One of your support staff colleagues (andreas.n) even already has suggested that and I quote:

"Actually "is_attachment" is a core WP function and using the very same name is a bit dangerous – actually "icl_is_attachment" would be better.."

see here: http://wpml.org/forums/topic/geo-mashup-and-wpml/#post-322137

So the (quite obvious) problem is that the code used is prone to conflicts.

I really hope that you (or the developers) can come back with something that works, because this is now a known issue for more than 6 months. Ignoring it is not a solution imho...

June 21, 2014 at 1:11 am #422839

Pieter

2 days since my original support request and still nothing?

OK, hack the plugin code directly it is then, not sustainable and not a solution at all, but obviously the only way to get Geo Mashup to work with WPML...

June 22, 2014 at 7:52 am #423084

Pieter

Turns out that editing sitepress.class.php brings along heaps of other conflicts, so will also not work.

What does work however is to completely disable the main WPML plugin for the specific page you run Geo Mashup on.

There are all kinds of functions available to do (check Google and/or Stackoverflow), but you can also install the nifty Plugin Organizer plugin: http://wordpress.org/plugins/plugin-organizer/

September 5, 2014 at 11:00 am #464456

guillermoC-2

Same problems here. First time working with WPML (full version purchased) for a project of WPML that makes intensive use of GeoMashup, and bam! I find this BIG compatibility issue. Would be great to know if WPML developers are working in a solution for that.... is very dissapointing 🙁
Thank you!

September 5, 2014 at 11:28 am #464495

Pieter

Had to dump the plugin I mentioned earlier as it doesn't seem to "remember" its settings.

Found another one though: Plugin Logic (http://wordpress.org/plugins/plugin-logic/) which seems to be holding up

October 13, 2014 at 8:42 pm #491566

fredericS-6

Same issue. Why this post is marked as resolved since it's not?

October 14, 2014 at 12:57 am #491622

Pieter

@frederics-6 you are right, the issue is everything but resolved. Unless of course you call using the plugin-logic plugin a solution 😉

What you can do is open a new thread to try to get attention for this issue (again).

If you do, please post the link here for others to chime in.

December 10, 2014 at 1:12 pm #526244

Soulard

Have you solve this? I am having the same issue here

December 10, 2014 at 1:46 pm #526269

Pieter

Disable WPML completely on the page where you have the GeoMashup map with the earlier mentioned plugin: Plugin Logic

Single maps works fine, the conflict is with the Mashup map.