diff -u b/modules/cloudinary_sdk/cloudinary_sdk.install b/modules/cloudinary_sdk/cloudinary_sdk.install --- b/modules/cloudinary_sdk/cloudinary_sdk.install +++ b/modules/cloudinary_sdk/cloudinary_sdk.install @@ -45,10 +45,11 @@ } elseif ($status == CloudinarySdkConstantsInterface::CLOUDINARY_SDK_OLD_VERSION) { $report['severity'] = REQUIREMENT_ERROR; - $report['description'] = t('Please make sure the Cloudinary SDK library installed is @version or greater. Current version is @current_version.', [ - '@version' => CloudinarySdkConstantsInterface::CLOUDINARY_SDK_MINIMUM_VERSION, - '@current_version' => $version, - ]); + $report['description'] = t('Please make sure the Cloudinary SDK library installed is @version or greater. Current version is @current_version.', + [ + '@version' => CloudinarySdkConstantsInterface::CLOUDINARY_SDK_MINIMUM_VERSION, + '@current_version' => $version, + ]); } else { // Ensure that the 3 required fields have been set. @@ -58,9 +59,10 @@ $report['severity'] = REQUIREMENT_WARNING; // Add link to configuration form. $url = Url::fromRoute('cloudinary_sdk.settings')->toString(TRUE)->getGeneratedUrl(); - $report['description'] = t("The required cloud name, API key and API secret of Cloudinary hasn't been set. Configure", [ - ':url' => $url, - ]); + $report['description'] = t("The required cloud name, API key and API secret of Cloudinary hasn't been set. Configure", + [ + ':url' => $url, + ]); } } @@ -99,3 +101,4 @@ - return $requirements; + return $requirements; + } } diff -u b/modules/cloudinary_stream_wrapper/cloudinary_stream_wrapper.module b/modules/cloudinary_stream_wrapper/cloudinary_stream_wrapper.module --- b/modules/cloudinary_stream_wrapper/cloudinary_stream_wrapper.module +++ b/modules/cloudinary_stream_wrapper/cloudinary_stream_wrapper.module @@ -13,47 +13,47 @@ /** * Flag for dealing with Cloudinary file. */ -define('CLOUDINARY_STREAM_WRAPPER_FILE', 0100000 | 0777); +const CLOUDINARY_STREAM_WRAPPER_FILE = 0100000 | 0777; /** * Flag for dealing with Cloudinary directory. */ -define('CLOUDINARY_STREAM_WRAPPER_FOLDER', 0040000 | 0777); +const CLOUDINARY_STREAM_WRAPPER_FOLDER = 0040000 | 0777; /** * The sample file name in root folder. */ -define('CLOUDINARY_STREAM_WRAPPER_SAMPLE', 'sample.jpg'); +const CLOUDINARY_STREAM_WRAPPER_SAMPLE = 'sample.jpg'; /** * The tag prefix of Cloudinary used for list folder items by tag. */ -define('CLOUDINARY_STREAM_WRAPPER_FOLDER_TAG_PREFIX', 'root/'); +const CLOUDINARY_STREAM_WRAPPER_FOLDER_TAG_PREFIX = 'root/'; /** * The resource_type of images on Cloudinary. */ -define('CLOUDINARY_STREAM_WRAPPER_RESOURCE_IMAGE', 'image'); +const CLOUDINARY_STREAM_WRAPPER_RESOURCE_IMAGE = 'image'; /** * The resource_type of none images on Cloudinary. */ -define('CLOUDINARY_STREAM_WRAPPER_RESOURCE_RAW', 'raw'); +const CLOUDINARY_STREAM_WRAPPER_RESOURCE_RAW = 'raw'; /** * Append type of image transformation. */ -define('CLOUDINARY_STREAM_WRAPPER_TRANSFORMATION_APPEND', 0); +const CLOUDINARY_STREAM_WRAPPER_TRANSFORMATION_APPEND = 0; /** * New type of image transformation. */ -define('CLOUDINARY_STREAM_WRAPPER_TRANSFORMATION_NEW', 1); +const CLOUDINARY_STREAM_WRAPPER_TRANSFORMATION_NEW = 1; /** * Multiple type of image transformation. */ -define('CLOUDINARY_STREAM_WRAPPER_TRANSFORMATION_MULTIPLE', 2); +const CLOUDINARY_STREAM_WRAPPER_TRANSFORMATION_MULTIPLE = 2; /** * Implements hook_help(). only in patch2: unchanged: --- a/cloudinary.module +++ b/cloudinary.module @@ -8,22 +8,22 @@ /** * Sample file on cloudinary for image effect preview. */ -define('CLOUDINARY_SAMPLE', 'cloudinary://drupal_sample.png'); +const CLOUDINARY_SAMPLE = 'cloudinary://drupal_sample.png'; /** * Url prefix of cloudinary preview image. */ -define('CLOUDINARY_PREVIEW_IMAGE_PREFIX', 'https://res.cloudinary.com/demo/image/upload/'); +const CLOUDINARY_PREVIEW_IMAGE_PREFIX = 'https://res.cloudinary.com/demo/image/upload/'; /** * Effects for effects param visible states. */ -define('CLOUDINARY_VISIBLE_STATES_EFFECT', 'sepia,brightness,saturation,hue,oil_paint,vignette,pixelate,pixelate_faces,gradient_fade,blur,tilt_shift,sharpen,unsharp_mask,pixelate_region,red,blue,green,contrast,vibrance,fill_light,blur_region,blur_faces,make_transparent,trim,shadow,colorize'); +const CLOUDINARY_VISIBLE_STATES_EFFECT = 'sepia,brightness,saturation,hue,oil_paint,vignette,pixelate,pixelate_faces,gradient_fade,blur,tilt_shift,sharpen,unsharp_mask,pixelate_region,red,blue,green,contrast,vibrance,fill_light,blur_region,blur_faces,make_transparent,trim,shadow,colorize'; /** * Crop mode for gravity visible states. */ -define('CLOUDINARY_VISIBLE_STATES_CROP', 'fill,crop,thumb,pad,lfill,lpad,mpad'); +const CLOUDINARY_VISIBLE_STATES_CROP = 'fill,crop,thumb,pad,lfill,lpad,mpad'; /** * Implements hook_theme(). @@ -82,7 +82,7 @@ function cloudinary_preprocess_image_style_preview(&$variables) { $variables['style_name'] = $style->label(); // Cache bypass token. - $variables['cache_bypass'] = REQUEST_TIME; + $variables['cache_bypass'] = \Drupal::time()->getRequestTime(); // Get sample image path from Cloudinary demo sandbox. $original = CLOUDINARY_PREVIEW_IMAGE_PREFIX . 'sample.jpg'; // Generate image style for provided sample image. only in patch2: unchanged: --- a/modules/cloudinary_storage/cloudinary_storage.module +++ b/modules/cloudinary_storage/cloudinary_storage.module @@ -9,12 +9,12 @@ use Drupal\Core\Form\FormStateInterface; /** * Flag for new resource of cloudinary_storage. */ -define('CLOUDINARY_STORAGE_NEW', 'new'); +const CLOUDINARY_STORAGE_NEW = 'new'; /** * Flag for remove resource of cloudinary_storage. */ -define('CLOUDINARY_STORAGE_REMOVE', 'remove'); +const CLOUDINARY_STORAGE_REMOVE = 'remove'; /** * Get all valid cloudinary storage info by hook_cloudinary_storage_info().