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.

Comments

snorkers’s picture

StatusFileSize
new734 bytes

Sorry here's the patch

squinternata’s picture

Title: Regex To Extract Embed Code over-simplified and defaults to Slideshare for all emvideo » to get all slideshare presentations in a drupal website by tag
Category: bug » task

Hi,
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?

wojtha’s picture

Title: to get all slideshare presentations in a drupal website by tag » Regex To Extract Embed Code over-simplified and defaults to Slideshare for all emvideo
Status: Active » Needs review
StatusFileSize
new2.11 KB

@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.
squinternata’s picture

Ok sorry!
do you mean i should create a new forum topic?
thank you
A

robcarr’s picture

StatusFileSize
new1.39 KB

I 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

robcarr’s picture

StatusFileSize
new1.32 KB

Sorry - uploaded wrong patch...

wojtha’s picture

@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...

wojtha’s picture

StatusFileSize
new2.18 KB

I found why my patch wasn't working I forgot to add allowed tags OBJECT and EMBED to filter_xss().

wojtha’s picture

StatusFileSize
new3.18 KB

Now 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.

robcarr’s picture

Sorry - hadn't even twigged there was a 2.x release of Emfield... using the latest 6.x-1.26 in Emfield

ademarco’s picture

Status: Needs review » Fixed

Thanks 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kclarkson’s picture

Status: Closed (fixed) » Active

Has 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.

rootwork’s picture

Category: task » bug
Priority: Normal » Critical
Status: Active » Reviewed & tested by the community

No, 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.

kclarkson’s picture

I 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

kclarkson’s picture

StatusFileSize
new110.91 KB
rootwork’s picture

@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.

kclarkson’s picture

@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.

kclarkson’s picture

To 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.

kclarkson’s picture

As 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

rootwork’s picture

Status: Reviewed & tested by the community » Fixed

This has (finally) been pushed to the current version, now 6.x-1.0-beta3. Hooray!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.