Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Name
Mixcloud field
Sandbox + git
https://drupal.org/sandbox/wouters_frederik/2201173
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/wouters_frederik/2201173.git mixcloud_field
*remark: code was checked with drupalcs and on http://pareview.sh/pareview/httpgitdrupalorgsandboxwoutersfrederik220117...
Description
A field that allows entry of mixcloud urls (similar to soundcloud urls).
This module also provides formatter_view with an embedded player for the referenced content.
Drupal version
7.x
Comments
Comment #1
PA robot CreditAttribution: PA robot commentedWe 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.
Comment #2
1point21 CreditAttribution: 1point21 commentedOverall a well implemented module using all standard Drupal methods and hooks to provide a field which can be added to any content type. This modules show a strong understanding of Drupal methods and best practices and gives sufficient options to get a Mixcloud player or links rendered on the page.
Suggestions
These are merely suggestions and not blockers depending on whether they match the goals of your module.
Default Width & Height
It might be helpful to move both of these settings into system variables using the variable_set function and the names "mixcloud_field_default_width" and "mixcloud_field_default_height". You can set the variables to your default values using hook_install and remember to also use hook_uninstall with variable_del("mixcloud_field_*") to clean up.
Mixcloud Player HTML
In the function "mixcloud_field_field_formatter_view" you render the HTML for the case "mixcloud_iframe" using strings and then replace URL values using preg_replace. It may be more user friendly to develop the query string using an array and then append the results of your logic using http_build_query after the '?'. This may make more sense to people who are not comfortable with even mild preg functions.
You could also take the player rendering one step further and move all of the code into a theme function or tpl file using hook_theme. This would allow people to override your theme or allow you to easily reuse the same render HTML if you need it some where else in your module, e.g. you add token support in the future.
Comment #3
wouters_f CreditAttribution: wouters_f commentedThanks for the review.
Added in suggested variables (width and height) and uninstall hook.
The mixcloud player html (formatter) is just one Iframe.
When tokens or a template would become needed I will code this in there. For the moment I don't think that is needed.
Comment #4
1point21 CreditAttribution: 1point21 commentedThe additions all look good to me.
Comment #5
ericthelast CreditAttribution: ericthelast commentedmanual review:
I agree with previous reviewers; very well done module. My only suggestion would be to remove the files[] in your .info file since D7 auto-includes those:
Other than that, looks great!
Comment #6
wouters_f CreditAttribution: wouters_f commentedI added this. Thanks for the review.
Comment #7
heddnMoving to RTBC. However, some feedback:
There are still a few non-blocking findings @ http://pareview.sh/pareview/httpgitdrupalorgsandboxwoutersfrederik220117...
module file:
Variable 'form' might have not been defined (at line 131)
No need to mention Pseudo-hook.
TODO's should be listed as @todo: https://drupal.org/coding-standards/docs#todo
Variables should use underscores as a separator ~line 197.
Use url() to build urls ~line 208. This lets the URL get altered with hook_url_outbound_alter().
Comment #8
wouters_f CreditAttribution: wouters_f commentedMost of them have now been addressed.
Thanks a lot!
Comment #9
kscheirerNon-blocking issues:
Checked for security, licensing, Drupal API, duplication, and individual account, no issues found.
Thanks for your contribution, drupal_sensei!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
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.
Thanks to the dedicated reviewer(s) as well.
Comment #10
wouters_f CreditAttribution: wouters_f commentedThanks for the thorough review! OMG first proper project application #yee_haw