Improve code style

Created on 3 February 2015, almost 10 years ago
Updated 26 September 2024, 3 months ago

Hello,

My IDE was highlighting too much code style problem so I decided to solve most ot the problems. Often comments wrong written, misspell errors, recommandations.

I think I found useless functions which does not work anymore in D7. Like :

/**
 * Add the Protected Node fieldset to the CCK.
 */
function protected_node_content_extra_fields($type_name) {
  $extra = array();

  $extra['protected_node'] = array(
    'label'       => t('Protected node'),
    'description' => t('Protected node module form.'),
    'weight'      => 20,
  );

  return $extra;
}

If think we need to use an hook_field_extra_field or something like that.

But I also found something more interesting (Thanks IDE), in protected_node.fork.inc, in the function protected_node_enter_any_password_validate :

$nid = db_query_range('protected_nodes', '', 1)
    ->fields(array('nid'))
    ->condition('protected_node_passwd', $passwd)
    ->condition('nid', $nids, 'IN')
    ->execute()
    ->fetchField();

db_query_range did not have the third parameter.

I am going to upload a patch. I just need the issue number.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024