Hey everyone,

With the beta release of Drupal 7 right around the corner, I wanted to see if anyone had begun planning of a Drupal 7 port. Our shop has mostly shifted to Drupal 7 development and I 'm interested to learn if any work has begun on D7....

Thanks,
Ben

Comments

aristeides’s picture

any news on this?

KirstenLangholz’s picture

Time has gone by without any answer. Can we get at least a rough time frame?

jtsnow’s picture

I haven't had time recently to work on a D7 port. I think that a D7 version should have a dependency on the Ctools module. It will provide the following features/APIs that Embed Widgets currently implements itself:
* Content -- pluggable content types used as panes in Panels and other modules like Dashboard. This will let us use the Ctools content API to embed content such as blocks, views, nodes, etc. in widgets instead of reinventing the wheel.
* Plugins -- tools to make it easy for modules to let other modules implement plugins from .inc files. Use the Ctools plugin system to allow plugins for different types of widgets (iframe, javascript, flash) and different providers.
* Contexts -- the notion of wrapping objects in a unified wrapper and providing an API to create and accept these contexts as input. We may be able to use this to determine when we are in a widget and when we are not.

Exportables and Object caching may also be useful.

micheas’s picture

How many hours would the D7 port likely take?

dav0’s picture

It seems like Drupal 7 is nearly completely dependent upon Ctools - not just this project, but many others - and is suffering without it.

aaron’s picture

Category: support » task
Status: Active » Needs work
StatusFileSize
new90.58 KB

here's a start. will post an updated version tomorrow (hopefully fully working).

aaron’s picture

note that this version doesn't include any dependency or work using ctools.

aaron’s picture

Status: Needs work » Needs review
StatusFileSize
new101.17 KB

OK, this works now, although I've only tested with embedding nodes thus far.

aaron’s picture

StatusFileSize
new101.27 KB

use this instead (adds a new theme function for the block content).

aaron’s picture

StatusFileSize
new101.37 KB

and this adds a wrapper to the block content...

BenK’s picture

Status: Needs review » Needs work

Hey aaron,

Great work so far on the Drupal 7 port! :-) Thanks so much for taking the initiative. It's working pretty well for a first pass. I've tested your patch and wanted to get you some quick feedback. So here are some bug/issues I noticed:

a) When I try to use the embed code on a view (or any teaser page), I get the following notices both within the widget (and on the view itself):

Notice: Undefined index: in embed_widget_view->__construct() (line 15 of /Users/benkaplan/git/commerce_quickstart3/sites/all/modules/contrib/embed_widgets/includes/widgets/embed_widget_view.inc).
Notice: Trying to get property of non-object in embed_widget_view->__construct() (line 15 of /Users/benkaplan/git/commerce_quickstart3/sites/all/modules/contrib/embed_widgets/includes/widgets/embed_widget_view.inc).
Notice: Undefined index: in embed_widget_view->__construct() (line 16 of /Users/benkaplan/git/commerce_quickstart3/sites/all/modules/contrib/embed_widgets/includes/widgets/embed_widget_view.inc).

This error appears on any view in which the "Widgets embed code" block is also appearing in a region on that page.

b) When looking at the configuration page of the "Widgets embed code" block, I'm getting the following notice at the top of the page:

Notice: Undefined index: block_settings in embed_widgets_ui_form_block_admin_configure_alter() (line 183 of /Users/benkaplan/git/commerce_quickstart3/sites/all/modules/contrib/embed_widgets/embed_widgets_ui/embed_widgets_ui.module).

c) On the configuration page of the "Widgets embed code" block, if I click the "Preview Widget" button, then I get the following browser error message:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /system/ajax
StatusText: Internal Server Error
ResponseText:

d) The module configuration options for opening links in separate windows ("Open only links to the listed pages in a new window." and "Open every link in a new window except links to the listed pages.") do not appear to be working yet.

e) The "Append widget link to blocks." setting does not appear to be working yet. At least, my understanding of that setting is that a "Share this widget" link should be appearing with site blocks. It doesn't yet.

f) Since we're using Drupal 7 here, how about incorporating build modes? It would be nice to allow a global configuration for which build mode to use as well as a build mode setting for the "Widgets embed code" block. This way, the site admin could specify, for instance, if the widget should use the "teaser" or "full node" build mode in the widget. What do you think?

You've done some nice work here and I'm eager to help get this to a stable version for D7. So if you can post an updated patch, I can test it right away and give you more feedback.

Cheers,
Ben

BenK’s picture

Hey aaron,

One more thing I forgot to mention in my prior note:

g) Currently, I see only one "Widgets embed code" block available on the block administration screen. I seem to remember more than one block being available (so that you could place embed code in different regions depending on the page). So either this feature got lost in the port or else I'm getting this confused with another module. In any event, it would be a nice feature to have.

--Ben

BenK’s picture

And two more things I just noticed:

h) To test the Views integration, I tried adding an "Embed Widget" display to a view (similar to adding a feed display). When I did this, I got a White Screen of Death. In my php error logs, I received this error:

PHP Fatal error: Call to a member function get_option() on a non-object in /Users/benkaplan/git/commerce_quickstart3/profiles/commerce_kickstart/modules/contrib/views/includes/admin.inc on line 1063

i) When I was in my php error logs, I also noticed the following error message:

PHP Fatal error: Call to undefined function taxonomy_link() in /Users/benkaplan/git/commerce_quickstart3/sites/all/modules/contrib/embed_widgets/includes/widgets/embed_widget_page.inc on line 89

I'm not quite sure which previously mentioned bug this is associated with.

--Ben

aaron’s picture

StatusFileSize
new100.83 KB

I haven't addressed @BenK's suggestions yet. But this one takes care of some sidebar issues when embedding a page.

BenK’s picture

@aaron: Thanks for posting the new patch. When do you think you'll be able to get to the items I posted? I can set aside time for additional testing later this week.

--Ben

Carlos Miranda Levy’s picture

subscribing

Sir Isaac’s picture

Hi All,

@aaron, thanks for the patch. It's just what my company needs. Sadly, this is my first attempt to patch a Drupal module, and it's not going well. I hope you guys can help.

Doing this on a Mac, w/ Mac OS 10.6.6, in Terminal using the patch command. The Mac is my laptop, not the server running Drupal.

1. I've downloaded the 6.x-2.x-dev version of Embed Widgets to a test directory on my Mac.
2. I place the patch file in the embed_widgets directory.

In Terminal, I go to the embed_widgets directory and run the following command:

patch < embed-widgets-d7-port-795226-14.patch  --dry-run --verbose

Things get off to a bad start. Here's the very start of the output…

Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/embed_widgets.info b/embed_widgets.info
|index 53da148..977f54b 100644
|--- a/embed_widgets.info
|+++ b/embed_widgets.info
--------------------------
Patching file embed_widgets.info using Plan A...
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file embed_widgets.info.rej

(Continuing the same output stream) Things seem to go better with the embed_widgets.install file, and with the module itself:

Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/embed_widgets.install b/embed_widgets.install
|index 898390f..30054d4 100644
|--- a/embed_widgets.install
|+++ b/embed_widgets.install
--------------------------
Patching file embed_widgets.install using Plan A...
Hunk #1 succeeded at 1.
Hunk #2 succeeded at 87.
Hunk #3 succeeded at 111.
 [...]
Patching file embed_widgets.module using Plan A...
Hunk #1 succeeded at 1.
 [...]
Hunk #26 succeeded at 903.

Then things get weird and come to an early & abrupt end:

Hmm...  The next patch looks like a unified diff to me...
can't find file to patch at input line 964
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/embed_widgets_ui/embed_widgets_ui.info b/embed_widgets_ui/embed_widgets_ui.info
|index 3e33ec5..d8d83cf 100644
|--- a/embed_widgets_ui/embed_widgets_ui.info
|+++ b/embed_widgets_ui/embed_widgets_ui.info
--------------------------

...After which the patch process drops me at the prompt: "File to patch: ".

Line 964 specifies the embed_widgets_ui.info file, which is where it should be. Here's line 964:

+++ b/embed_widgets_ui/embed_widgets_ui.info

I'd know where to look next if it failed completely, but with this mix of success & failure for different files, I'm at a loss.

Anyone know what might be going on?

Jackinloadup’s picture

subscribing - can't wait for a block or view display.

I believe if i can get one of those working i will get what i need. I will try to play around with this myself. no promises though.

Syph’s picture

Hi all,

I cant patch it either, can someone zip and upload a patched version please.

Kind Regards,

Aaron

Jackinloadup’s picture

@Syph

try applying the patch with git

git apply -v [patchfile]

Syph’s picture

ty Jackinloadup, has anyone made any progress with block or views?

Jackinloadup’s picture

I made an attempt but figured out how to get page to do what I needed. As far as I can see node and page are the only ones working. Just an FYI for everyone else at this point.

Syph’s picture

im still not able to patch it for some reason. ill keep trying and let you know what happens

shunting’s picture

subscribe

bryancasler’s picture

Can anyone post a summary of how far along this module is for a stable D7 release and what's holding it up?

BenK’s picture

A QUICK ISSUE SUMMARY:

@animelion: Basically, the patch in comment #14 is the latest. But all of the errors/bugs I described in comments #11, 12, and 13 still need to be fixed to make it usable.

What has been holding up the porting of this module has been the lack of an active maintainer. @aaron has made some nice code contributions, but he hasn't been around of late. I'm happy to do a lot of testing, but can't really do the heavy code lifting. So we really need someone new to step up and become a co-maintainer of this module to get it fully to Drupal 7. Any takers?

--Ben

BeaPower’s picture

sub

podarok’s picture

subscribe

SilviaT’s picture

sub

Cray Flatline’s picture

+стопицот

nedjo’s picture

Note that there is a D7 dev release of Web Widgets, http://drupal.org/project/web_widgets, which seems to provide some similar functionality. I haven't tested it.

chertzog’s picture

StatusFileSize
new104.2 KB

Here is a patch that cleaned up a lot of the issues identified in #11. This should make it so that block widgets are working. still working on others, but here is a better start.

This patch includes stuff from the patches above so apply this to 6.x-2.x.

chrowe’s picture

I have tried applying the patch from #33 to embed_widgets-6.x-2.x-dev and embed_widgets-6.x-2.0-alpha2 using bot "git apply " and "patch -p1 < "

The best result seemed to be with 6.x-2.0-alpha2 and "patch -p1 < " but one file still failed to apply.

patching file embed_widgets.info
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file embed_widgets.info.rej

nedjo’s picture

Thanks all for the work on updating.

A couple of points from a quick scan:

+++ b/embed_widgets.module
@@ -9,13 +9,13 @@
+    'description' => 'The embedded file. ',

There are a lot of mistaken additions of a space between a period and an end quote, as here. Maybe a cut and paste error?

+++ b/embed_widgets.module
@@ -40,55 +40,61 @@ function embed_widgets_menu() {
+  global $_embed_widgets_mode;

Should be replaced with a drupal_static() call.

This patch is a hard to review partly because it mixes in a lot of code styling updates.

chrowe’s picture

Ok, got it to work after cloning the git repo

git clone --recursive --branch 6.x-2.x http://git.drupal.org/project/embed_widgets.git
cd embed_widgets

and applying the patch

wget http://drupal.org/files/embed_widgets-d7.patch
git apply embed_widgets-d7.patch

The widget preview seems to work but can't find a way to view the "Share this Widget!" link to show up using the "Append widget link to blocks." option.
Also, it would be nice if the widget was disabled by default. I only want it on one block.

chertzog’s picture

Title: Drupal 7 port » Drupal 7 port of Embedded Widgets

Sorry about the code styling mixed with upgrades, I kind of try to fix things as i see them. I havent had much time to work on this as other projects have needed my attention, but those other projects are winding down, and i will be picking this up again shortly.

nzcodarnoc’s picture

Just confirming I've used the the #14 patch to embed a webform in an iframe.

alexio2170’s picture

I'm still having problems with the views embedded widgets as described in #11 and following.
Did anybody solve someway?
Many thanks!