Lovely module, but found that if any URL [eg, from another video provider] is pasted into URL/Embed code, the emvideo_slideshare_extract() will just return the first sequence of numbers it finds and assumes it is Slideshare. So, for example, it might extract 1 or 2 sequential digits from a YouTube ID... and assume it is a Slideshare presentation.
The trouble occurs in this line (about #75 in emvideo_slideshare_extract()):
if (preg_match('/[0-9]+/',filter_xss($embed, array('div')),$matches))
And it needs to be a little more detailed to pull out the Slideshare ID, which I believe is universally preceded by __ss_. Rolled a really simple patch for this.
Even this may be a little too naive, so any regex/Slideshare experts feel free to work on this. There may also be a module weighting issue within emfield, but don't understand the emfield piece too well to know if that's even a correct statement.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | slideshare-screenshot.png | 110.91 KB | kclarkson |
| #9 | slideshare_broken_2.patch | 3.18 KB | wojtha |
| #8 | slideshare_broken_1.patch | 2.18 KB | wojtha |
| #6 | slideshare-embed.patch | 1.32 KB | robcarr |
| #5 | slideshare_broken_provider.patch | 1.39 KB | robcarr |
Comments
Comment #1
snorkers commentedSorry here's the patch
Comment #2
squinternata commentedHi,
I would need to obtain in my website all the presentations for my user by tag..for example with a feed..
now i have to use slideshare api to do this..but it s difficult to create a drupal module?
Comment #3
wojtha commented@squinternata Please ask in support forums or at IRC support channel and please don't change titles in the issue queue in this way! I'm returning title to its previous state - and meaning.
I think this code isn't the solution. Since this module currently doesn't know how to handle Slideshare presentation by knowing only its ID.
I fixed couple other issues in the patch, the module was completely broken (against Embedded Media Field 2.x). Now it works, but only partly. Only embedded string is working now - you need to copy whole embedded code (or at least the part between
tags). The Slideshare support which provides this module is very basic (e.g. in comparison to Media: Youtube). The development is still on the beginning. #982350: When Slideshare support is enabled the URL is always parsed as a Slideshare URL marked as a duplicate of this issue.Comment #4
squinternata commentedOk sorry!
do you mean i should create a new forum topic?
thank you
A
Comment #5
robcarrI tried your patch (#3), although the code to adjust the theme.inc file didn't roll well... and the embedded Flash slideshow doesn't render with that patch. However, your patch seems to work if the slideshare.theme.inc line 15 is left alone:
preg_match_all('/<object[^>]*>(.*?)<\/object>/', $item['data']['EMBED'][0], $matches);Re-rolled patch without theme.inc. Tried it with a URL and the Embed code.
Need another to RTBC this issue
Comment #6
robcarrSorry - uploaded wrong patch...
Comment #7
wojtha commented@squinternata yes create new forum topic - check link Community & Support on the top of this page.
@arrrgh what version of Embed media field are you using? 1.x? I think thats the difference... I'm using 2.x version of embed media field...
Comment #8
wojtha commentedI found why my patch wasn't working I forgot to add allowed tags OBJECT and EMBED to filter_xss().
Comment #9
wojtha commentedNow it should work for all types of given input - embed code, URL and wordpress style. Rember to setup Slideshare API keys at admin/content/emfield/emvideo if you want to use input type #2 or #3.
Comment #10
robcarrSorry - hadn't even twigged there was a 2.x release of Emfield... using the latest 6.x-1.26 in Emfield
Comment #11
ademarco commentedThanks for the patch. Tested with emfield 6.x-2.4 and 6.x-1.26: it works good. Committed to HEAD: http://drupal.org/cvs?commit=482222
Comment #13
kclarkson commentedHas this patch been added to the module?
I have uploaded the dev versions of both emfield and slideshare but am still getting this error where the youtube links are being id as slideshare and the files are not showing.
Comment #14
rootworkNo, it hasn't -- there hasn't been a new version rolled since 2009.
Is the maintainer out there? Can we get this posted, even if it's just as a dev? Right now this module breaks all other emfield-video fields. This is an urgent issue for this module.
Comment #15
kclarkson commentedI have also just tested the last patch and it works great. I now have slideshare and you tube media embedded into my site as content types. See attached screenshot.
A couple of issues regarding the patch though:
1. I didn't realize that I had to upload the patch in the providers folder. Not until I opened the patch and read the file.
2. I got an error regarding the patch:
providers kclarks2$ patch < slideshare_broken_2.patch
patching file slideshare.inc
can't find file to patch at input line 55
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git slideshare.theme.inc slideshare.theme.inc
|index 73bce3f..bf7c2e0 100644
|--- slideshare.theme.inc
|+++ slideshare.theme.inc
--------------------------
File to patch: slideshare.theme.inc
slideshare.theme.inc: No such file or directory
Skip this patch? [y] y
Skipping patch.
1 out of 1 hunk ignored
Comment #16
kclarkson commentedComment #17
rootwork@kclarkson: Yes, that's how patches work. For more info on applying patches, see http://drupal.org/node/707484 (toward the bottom). I'm not sure what you're screenshot is supposed to indicate.
Still hoping this critical patch can be applied and rolled into a dev.
Comment #18
kclarkson commented@rootwork,
the screenshot was just to show that it works as intented. Hoping someone would see it and add it to the release.
I am just getting a hang of adding patches but this was the first patch I received that gave me an error. Wasn't sure if the patch needed to be altered to avoid the error.
Comment #19
kclarkson commentedTo all,
So I got this module to work alongside the the Youtube & Flickr media modules after updating to the most recent dev release of Emfield and adding the patch to the Slideshare 6.x-1.0beta1 http://drupal.org/node/760698#comment-3835962
This was and still is working on my Local machine but after uploading it to my live site, I can no longer see the the Slideshare media but the youtube and flickr works just fine.
There was another issue in the queue that suggested to change the &$node on lines 170 & 178 to $node but that did not fix the issue. http://drupal.org/node/1119488#comment-5016118
The only thing that is different from my local and live sites is in the Embed Media Field general settings. It has the the JW FLV Media Player: settings pointing to sites/all/modules/mp3player/mp3player/player.swf . I have tried deleting the url but it keeps defaulting to that url.
Not sure where to go from here as I cannot release a site until this module can be implemented. My client has a tone of slideshare presentations and specifically wants to have them embedded as content types.
Any help would be appreciated.
Comment #20
kclarkson commentedAs cafuego state in another issue. Just download the development version of slideshare.
Everything works as intended.
Here is the link for us newbies: http://ftp.drupal.org/files/projects/slideshare-6.x-1.x-dev.zip
Comment #21
rootworkThis has (finally) been pushed to the current version, now 6.x-1.0-beta3. Hooray!