While running coder for converting module from D6 to D7, would be good to catch calls to file_create_path(), which has been deprecated in D7. The following (WIP) snippet appears to work:

Please review:

--- a/coder_review_7x.inc
+++ b/coder_review_7x.inc
@@ -1227,6 +1227,22 @@ function coder_review_7x_reviews() {
'#link' => _drupalnode(224333, 'drupal_clone'),
),
);
+/* -- nk. file_create_path */
+ $rules[] = array(
+ '#type' => 'regex',
+ '#value' => '[\s\(]file_create_path\s*\(',
+ '#warning' => '_coder_review_7x_file_create_path_warning',
+ '#warning' => array(
+ '#text' => '!file_create_path() has been removed. Use file_prepare_directory() instead',
+ '#args' => array(
+ '!file_create_path' => _drupalapi('file_create_path', 6),
+ '!file_create_path' => _phpapi('file_create_path'),
+ ),
+ '#link' => _drupalnode('224333', 'file_prepare_directory'),
+ ),
+ );
+
+
$rules[] = array(
'#type' => 'regex',
'#value' => '[\s\(]actions_synchronize\s*\((\$actions|[^,]+,)',

CommentFileSizeAuthor
coder-file_create_path.patch900 byteskrishnan.n
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

klausi’s picture

Status: Needs review » Closed (won't fix)

Coder 7.x is frozen now and will not receive updates. Coder 8.x-2.x can be used to check code for any Drupal version, Coder 8.x-2.x also supports the phpcbf command to automatically fix conding standard errors. Please check if this issue is still relevant and reopen against that version if necessary.