The Drupal status report says:

Error JCarousel plugin Not found
You need to download the JCarousel plugin and move the content of the downloaded folder into the /sites/all/libraries/jquery.jcarousel folder of your server.

JCarousel is optional, not a requirement, so this should not be marked an error. Perhaps a warning. Even better: check if it is used at all.

Comments

davisben’s picture

Status: Active » Needs review
StatusFileSize
new3.13 KB

Here's a patch that will check if any field is using a carousel pager, and only run the requirement check if it is in use.

mrfelton’s picture

Works for me. Thanks.

gaele’s picture

Status: Needs review » Reviewed & tested by the community

Thanks.

steven jones’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the patch 10oclock, but querying the database directly for this information is just the wrong way to go, instead we should be using the Field info API, probably field_info_instances.

davisben’s picture

Status: Needs work » Needs review
StatusFileSize
new2.86 KB

Thanks for the pointer. Here's an updated patch using field_info_instances.

steven jones’s picture

Status: Needs review » Needs work

Awesome work! Looking good except for one thing:

+++ b/field_slideshow.install
@@ -32,25 +32,39 @@ function field_slideshow_requirements($phase) {
+    foreach (field_info_instances('node') as $type) {
+      foreach ($type as $fields) {
+        foreach ($fields['display'] as $display) {
+          if ($display['type'] == 'slideshow' && $display['settings']['slideshow_pager'] == 'carousel') {
+            $carousel_used = TRUE;
+            break;
+          }
+        }
+      }

You can apply a field slideshow to any entity, not just a node, so this needs another foreach in here, so it looks something like:

    foreach (field_info_instances() as $bundles) {
      foreach ($bundles as $instances) {
        foreach ($instances as $field) {
          foreach ($field['display'] as $display) {
            if ($display['type'] == 'slideshow' && $display['settings']['slideshow_pager'] == 'carousel') {
              $carousel_used = TRUE;
              break 4;
            }
          }
        }
      }
    }
davisben’s picture

Status: Needs work » Needs review
StatusFileSize
new2.93 KB

Patch updated to reflect the comments in #6.

steven jones’s picture

Status: Needs review » Reviewed & tested by the community

Great stuff, this patch is good to go!

jdanthinne’s picture

Status: Reviewed & tested by the community » Fixed

Thanks guys! Commited and pushed to DEV.

Status: Fixed » Closed (fixed)

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