Project page: https://www.drupal.org/sandbox/bogdan1988/2176241
Git repository: http://git.drupal.org/sandbox/Bogdan1988/2176241.git
Pareview: http://pareview.sh/pareview/httpgitdrupalorgsandboxbogdan19882176241git

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Bogdan1988/2176241.git video_embed_aol

Drupal version: 7, Dependencies: video_embed_field

This module provides integration for AOL ON video network with "Video Embed Field" module.

The user can use AOL ON video URL or AOL ON video ID to identify the video in the field.

CommentFileSizeAuthor
#7 drupal.png49.28 KBDavid Witczak
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

guardiola86’s picture

David Witczak’s picture

Hello dstorozhuk,

Please add git clone command :
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Bogdan1988/2176241.git video_embed_aol

I suggest using require_once DRUPAL_ROOT rather than module_load_include() video_embed_aol.module - line 10 :
require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'video_embed_aol') . '/video_embed_aol.video_embed_field.inc';

In the creation of a new field I obtain an error :
Undefined index: use_id in video_embed_aol_form_field_ui_field_edit_form_alter() - (line 35)

For video_embed_aol.js, add semicolon lines 15, 28, 32, just for perfect.

Other than that, I think it looks okay.

dstorozhuk’s picture

Issue summary: View changes

Add git clone command in description.

dstorozhuk’s picture

David Witczak, thank you for your review, I have fixed issues about git clone command and semicolons.

I can't reproduce issue with "Undefined index: use_id". Probably, you had have installed Video Embed module, and cache wasn't reseted?

Can you, please, explain the reasons of using require_once instead of module_load_include? Thanks.

gwprod’s picture

A few issues:

Web service providers have a tendency to, ahem, change things. It might be a good idea to make

define('VIDEO_EMBED_AOL_API_SINGLE_VIDEO_ENDPOINT', 'http://api.5min.com/video');

a setting that can be changed by the user.

I'm not sure that

$cached = & drupal_static(__FUNCTION__ . $video_id, '');

is equivalent to

$cached = &drupal_static(__FUNCTION__ . $video_id, '');

In

$parsed = @parse_url($url);

What error are you trying to suppress? Is it necessary?

In video_embed_aol_video_embed_handler_info
your array keys should use '', not "".

When you attach behaviors in your JavaScript, you should ensure that you are only attaching to new items, by using context.

I see no reason why module_load_include is a bad idea here. It provides consistency and is The Drupal Way ™

David Witczak’s picture

FileSize
49.28 KB

Hello,

- for module_load_include, sorry for I thought that it was necessary to use it for include of another module.

- for issue with "Undefined index: use_id"

  1. I installed a new drupal
  2. I installed modules Chaos Tools, Entity API, Video Embed Field and Video Embed AOL
  3. Clear all caches
  4. Then I go structure -> content types -> manage fields (article) -> Add new field (Field type text) -> save -> save field settings
gwprod’s picture

You may use module_load_include to load any include files, whether of this module, or of other modules, though if it is another module, it pays to verify the module is installed first.

dstorozhuk’s picture

gwprod, my opinion about ways to defining the AOL ON API endpoint was the next idea: when provider changing the endpoint, he usually also changing the whole API interface. In this case, most parts of module should be changed. So, I don't see any objective reasons to create admin interface to manage AOL ON API endpoint.

Since D7 requires 5.2.5 (minimum) and E_WARNING (when URL parsing failed) was removed only in 5.3.3, I decided suppress possible errors for oldest PHP versions.

Done:
Replaced "" with ''.
Process video boxes only once.

I didn't found any difference between & drupal_static and &drupal_static but, since in drupal core developers use &drupal_static, I have removed the space.

dstorozhuk’s picture

David Witczak, Thanks, for steps to reproduce.

gwprod’s picture

@dstorozhuk

I think all of that makes sense.

dstorozhuk’s picture

David Witczak, I see the error, thanks for a catch.

The issue with Undefined index: use_id in video_embed_aol_form_field_ui_field_edit_form_alter() has been fixed.

Daniel.Moberly’s picture

You are using a variable called "$posible_video_id" in multiple places - nitpicky, but its spelled wrong - might want to change it to "$possible_video_id" for readability.

Line 110: this entire function could be simplified by simply returning FALSE after all the if statements - you don't need to have 3 "return FALSE" statements. The outer "if" statement can also be removed as "if (isset($parsed['path']))" performs the same check as "if ($parsed)"

Line 190: You might consider a regular expression to validate the URL rather than exploding the string and checking the parts. It also looks like you are only checking the "video" part of the URL - don't you want to check the "on.aol.com" part as well? Right now it looks like I could submit "http://www.youtube.com/video/testvideo" and have the URL accepted.

dstorozhuk’s picture

Daniel.Moberly, I agree with your first two comments and I have fixed them.

I disagree with the third one. Here is a few things why:
- video_embed_field module already has domaine validation.
- video_embed_field module has builtin support for youtube so it should accept youtube URL's
- I believe "explode" for small piece of text is much faster than regular expression

Thanks for your review.

dstorozhuk’s picture

Issue summary: View changes
SolidOpinion’s picture

Automated review
a lot of errors. Please see
http://pareview.sh/pareview/httpgitdrupalorgsandboxbogdan19882176241git

Manual view
$ git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Bogdan1988/2176241.git video_embed_aol
Cloning into 'video_embed_aol'...
fatal: repository 'http://git.drupal.org/sandbox/Bogdan1988/2176241.git/' not found

mparker17’s picture

Looks like this was already promoted to a full project: https://www.drupal.org/project/video_embed_aol

mparker17’s picture

Status: Needs review » Closed (fixed)
mparker17’s picture

Assigned: dstorozhuk » Unassigned
apaderno’s picture

Issue tags: -, -#video, -video embed, -#field