Both oneboxes show in preview, but not when cooked.
@boomzilla was able to uncover some extra info: Job exception: undefined method 'split' for nil:NilClass
Env:
current_db: default
current_hostname: what.thedailywtf.com
message: While trying to onebox a URL
url: https://www.google.com.a/maps/place/Rheinbiss+652/@50.718779,7.129456,17z/data=!3m1!4b1!4m2!3m1!1s0x47bee15c59b6b135:0x9d379982efb7740b
The problem is that these URLs do not resolve into “canonical” URLs, so the current version of the oneboxer simply bails out. I have no idea why the one on meta accepts these URLs… is this perhaps actually an older version?
Except that the stuff works in the preview but not the final post (in the older version we’re running, not the latest version here on meta, where it all seems to work).
There have been (and surely still are) a lot of things that work differently in preview and final. Which is insane from a user’s point of view.
Actually, no, things shouldn’t be working differently in preview and final. Both are processed by the same JavaScript code, and both invoke the same onebox engines. Oneboxes may be rendered differently in preview to avoid rapid reloading of iframes (after all, each time the preview is re-rendered, the entire cooked HTML is ripped out of the DOM and replaced), but as far as the GoogleMapsOnebox engine is concerned, both cases invoke the exact same code path through the initializer and resolve method.
As for why it works in preview but not in the final result? Heck if I knew. Right now, when you invoke the current version of GoogleMapsOnebox with either URL you’ve posted above, the engine’s initializer raises an ArgumentError because it doesn’t recognize the URL.
Previews must be static images or else each update of the composer preview pane would cause a reload of the embedded iframe. Google would probably consider this abuse, and browser performance would plummet straight to hell.
I can only display static maps using data found in any of the available URLs that directly maps to data the static map API will accept. This is not the case for the cid field that contains the ID of the custom map, let alone the protobuf-encoded data field in the source URL. Thus, markers placed on custom maps will not appear on any previews.
For a reason I have not (yet) figured out, Google’s webserver does sometimes, but not always, redirect @RaceProUK’s source URLs to the “canonical” Google maps URL. This seems to be totally random and may or may not be a transient problem. The engine now tries up to 10 times to get the canonical URL; if this fails, it constructs a fallback more or less blindly, based on assumptions and circumstancial evidence regarding the encoding of the data parameter.
By the way: the second URL fails because you do have an outdated onebox version. classic_google_maps_onebox.rb no longer exists in the current version of the gem.
@zogstrip, should I bump onebox’s version in my PRs?
Yes - my users are complaining about this issue too. I try to post a map, it shows up in preview, and for just a second or two in the final post, then it disappears.