This module allows a drupal administrator to create blocks dynamically by "connecting" the module to their active ZeitConnect account. Each use who registers with the ZeitConnect service will be assigned an API key. They can enter this key in the module's configuration page. The configuration page will update with a list of available widgets. The user can then mark checkboxes to indicate which widgets they would like to make blocks for. Once this is done, they can go to the standard "blocks" page and enable the blocks in the standard way.

I'm not aware of any similar projects . . .

The ZeitConnect connect website, which includes a description of the service is:

http://www.zeitconnect.com

An example of a widget being rendered on our demo site can be seen here:

http://www.pinklot.us/classes

The module source has been pushed to:

git clone --branch master tonybuckingham@git.drupal.org:sandbox/tonybuckingham/1475676.git

project:
http://drupal.org/sandbox/tonybuckingham/1475676

Currently, this is a Drupal 7 module only; will most likely be developing a Drupal 6 version as well.

Reviews of other projects:
http://drupal.org/node/1475184#comment-5718090
http://drupal.org/node/1476916#comment-5718354
http://drupal.org/node/1459628#comment-5727438

http://drupal.org/node/1478968#comment-5732004
http://drupal.org/node/1413072#comment-5732444
http://drupal.org/node/1445414#comment-5733242

http://drupal.org/node/1485756#comment-5781194
http://drupal.org/node/1370952#comment-5781016
http://drupal.org/node/1498892#comment-5780702

Comments

patrickd’s picture

Status: Needs review » Needs work

welcome,

i've added the missing project link

you're not authenticated to git correctly, so commits won't be associated with your useraccount,
have a look at the git instructions on your project page.

You are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
(At least this has to be done before switching back to needs review)

while waiting for an in-depht review of your module you can start out fixing some coding style issues detected by automated tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxtonybuckingham1475676git

You can also get a review bonus and we will come back to your application sooner.

regards

tonybuckingham’s picture

Ok, I've made those changes . . .

tonybuckingham’s picture

Status: Needs work » Needs review
anilbhatt’s picture

Manual Review:
1. Write hook_uninstall() to unset your variables.
2. In zeitconnect.admin.inc > line 81 use drupal_write_record() instead of db_query();
3. Replace 'delete queries' or 'select queries' with db_delete() or db_select() respectively.
4. In zeitconnect.admin.inc > line 23 use t() function to wrap description.
5. In zeitconnect.admin.inc > line 32, if you are not using $keys, then remove it.
6. Declare the $names before the foreach statement on line 33, in zeitconnect.admin.inc.

anilbhatt’s picture

Status: Needs review » Needs work
tonybuckingham’s picture

Status: Needs work » Needs review

Thanks Anil,

I've made the changes you recommended . . .

For anyone testing this module, you can use the following API token when configuring the module:
5a66d5c10260f6b162731a499cf325de

anilbhatt’s picture

StatusFileSize
new26.3 KB

Manual Review:
1) admin.inc line 28, t() function missing, every description and title of form element should be wrap with this function.
2) When i installed your application and visit the admin page i got the following warnings:

   Warning: file_get_contents(http://www.zeitconnect.com/api/widgets/token/) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in zeitconnect_admin_settings_form() (line 30 of zeitconnect\zeitconnect.admin.inc).
    Warning: Invalid argument supplied for foreach() in zeitconnect_admin_settings_form() (line 33 of zeitconnect\zeitconnect.admin.inc).

3) After submit i got these messages
Notice: Trying to get property of non-object in zeitconnect_admin_settings_form_submit() (line 83 of zeitconnect\zeitconnect.admin.inc).
Notice: Trying to get property of non-object in zeitconnect_admin_settings_form_submit() (line 83 of zeitconnect\zeitconnect.admin.inc).
4) Block description is showing blank. See attached block.png file.

anilbhatt’s picture

Status: Needs review » Needs work
tonybuckingham’s picture

Status: Needs work » Needs review

Thanks Anil,

To address each of your points:
1) fixed . . .
2) My understanding from reading more about the file_get_contents function is that it is susceptible to connectivity issues related to firewalls and proxies. I have modified my code to use standard sockets instead, and have included better handling to catch connectivity issues.
3) fixed . . . will check the contents of $widget before trying to parse it
4) in an older version of the 'zeitconnect' schema I was using 'wname' as one of the table columns. The new schema uses 'name' for that field. I suspect your database may have had an old version of the zeitconnect table. Please be sure to fully uninstall and re-install the module when testing again.

Thanks for your help!

tonybuckingham’s picture

Issue summary: View changes

added project page

tonybuckingham’s picture

Issue summary: View changes

Add a project I manually reviewed

tonybuckingham’s picture

Issue summary: View changes

Add another manually reviewed project

tonybuckingham’s picture

Issue tags: +PAreview: review bonus

Adding "review bonus" tag

chhavik’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus
  • I installed your module, the 'Basic YY widget' content is too long, i would suggest to use some pagination.
  • 'Widget 0f06b' block doesn't show any content and keeps on loading, screenshot attached.
  • zeitconnect.admin.inc - line #7,8,9 Its a menu callback function, not a hook.
  • zeitconnect.admin.inc - line #28, Block link is broken.
    use l() function here as it contains link
  • zeitconnect.module- line #30, wrap t() inside l().
chhavik’s picture

StatusFileSize
new77.26 KB

Forgot to attach screenshot, here it is.

tonybuckingham’s picture

Status: Needs work » Needs review

Thanks . . . I have made the changes you recommended.

In the case of the "non-loading" widget, what was happening is that two widgets had been enabled on the same page. The javascript responsible for rendering these widgets does not support this, but as you have demonstrated, it is clearly a circumstance which can come about when using this drupal module. I have added logic to the widget loading script to detect whether another widget already exists on the page, so that the user will see a notification message instead of the never-ending "loading" gif.

ZeitConnect is actually an active service currently in use by several customers. The data being used in this example comes from a Yoga studio that happens to have a lot of active classes across 5 studios, and the particular widget you are referring to (Basic YY widget) was configured in the system to include *all* classes in all five studios. I have created a new widget in the system which demonstrates how a customer would normally configure a widget for use on the site. If you re-visit the module's configuration page, you'll see a new widget, "One studio" which includes data for only one location. It is up to the customer to configure each widget in determining how much data will be included.

The majority of our customers don't have as many classes as this particular customer, so the widget's "length" is simply not an issue with the average customer. We have discussed pagination with Yoga Yoga in particular and they have indicated they feel it is important to display an entire week's worth of data on one page. The widget does, of course, include four configurable "filters". On the "Basic YY widget", you'll notice that you can select a "location" from one of the dropdowns at the upper right of the widget to reduce the "length" of the widget.

Here is an example of an actual customer's schedule on their site: http://www.yogayoga.com/schedule

tonybuckingham’s picture

Issue summary: View changes

Added reference to manually reviewed project

tonybuckingham’s picture

Issue summary: View changes

Adding to list of projects reviewed

tonybuckingham’s picture

Issue summary: View changes

Adding another reviewed project to the list

tonybuckingham’s picture

Issue tags: +PAreview: review bonus

Adding "review bonus" tag

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

manual review:

  • zeitconnect_menu(): indentation errors, each level should use 2 spaces, not more.
  • zeitconnect_menu(): do not use t() in hook_menu().
  • zeitconnect_help(): do not concatenatre translatable strings, use a placeholder for the link instead.
  • zeitconnect_block_view(): do not add javascript yourself, use drupal_add_js() or #attached in a renderable array.
  • zeitconnect_admin_settings_form(): do not use json_encode(), use drupal_json_encode(). Same for json_decode().
  • "'#value' => ' Save Settings ',": all user facing text should run through t() for translation.
  • "$types = array('1' => 'Schedule', 2 => 'Prospect', 4 => 'Enrollment');": same here. Please check all your strings.
  • zeitconnect_get_widgets(): why can't you use drupal_http_request()?

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

tonybuckingham’s picture

Status: Needs work » Needs review

Thanks, klausi, I've made the changes you recommended . . .

I found, however, that both drupal_add_js and the #attached array method insert javascript into the head of the document. In this case, I actually need the script tag to be inserted into the contents of the block where the javascript will perform its rendering, so neither of those approaches is applicable.

tonybuckingham’s picture

Issue summary: View changes

Adding to reviewed project list

tonybuckingham’s picture

Issue summary: View changes

Adding another project reviewed

tonybuckingham’s picture

Issue summary: View changes

Adding another reviewed project

tonybuckingham’s picture

Issue tags: +PAreview: review bonus

Adding review bonus tag

klausi’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

manual review:

  • zeitconnect_admin_settings_form_submit() and zeitconnect_admin_settings_form_validate(): these are not hooks, see http://drupal.org/node/1354#forms on how to document them.
  • "variable_get('zeit_' . $widget['wkey'], ''),": all variable names of your module should be prefixed with the full name of your module, i.e. zeitconnect. That avoids name collissions with other modules.

But that are just minor issues, otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

klausi’s picture

Assigned: Unassigned » tim.plunkett

Assigning to tim.plunkett as he might have time to finally approve this.

tonybuckingham’s picture

Thanks, klausi, I made those changes . . .

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
Status: Reviewed & tested by the community » Fixed
StatusFileSize
new4.93 KB

This looks great! I've attached a patch with a few tweaks, but nothing major.

Welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Added another reviewed project