Hi,
I have succesfully installed the Drupal 7 Weblinks module from the homepage: http://ftp.drupal.org/files/projects/weblinks-7.x-1.x-dev.tar.gz

I added the weight module, because I use this to order the nodes (www.drupal.org/project/weight )

After enabling the weight module in relation to weblinks module I cannot save a weblinks node anymore.
I always get the message:

Weight is a required field.

I thought it was a Weight problem (http://drupal.org/node/1987320)
But the error only occurs using Weblinks! Other contenttype work fine.
So it must be something with Weblinks..

Greetings, Martijn

Comments

summit’s picture

Hi,

I also see here: http://drupal.org/node/1363410#comment-5926806 that Weight should be used..
But until now, I am unsuccesfull in using this with latest 7.x Weblinks

How could I proceed please?
greetings, Martijn

summit’s picture

Hi,
I had to change this to get it working in weblinks.module:

// If the weight module is available, skip this.
  $form['node_weight'] = array(
    '#type' => module_exists('weight') ? 'value' : 'weight',
    '#title' => t('Weight'),
    '#default_value' => isset($node->node_weight) ? $node->node_weight : 0,
    '#description' => t('In listings, the heavier terms (with a larger weight) will sink and the lighter terms will be positioned nearer the top.'),
    '#access' => user_access('administer weblinks'),
    '#required' => FALSE,   <=== Make TRUE to FALSE !!
  );

I think also based on this remark http://drupal.org/node/1363410#comment-5926806 that the whole Weblinks Weight stuff should be ripped out.
Also a database update should then be made to remove the weight field from the weblinks TABLE.

Greetings, Martijn

GStegemann’s picture

OK, I found this place as well.

The change should be modified a bit:

  // If the weight module is available, skip this.
  $form['node_weight'] = array(
    '#type' => module_exists('weight') ? 'value' : 'weight',
    '#title' => t('Weight'),
    '#default_value' => isset($node->node_weight) ? $node->node_weight : 0,
    '#description' => t('In listings, the heavier terms (with a larger weight) will sink and the lighter terms will be positioned nearer the top.'),
    '#access' => user_access('administer weblinks'),
    '#required' => !module_exists('weight') ? TRUE : FALSE,
  );

Regarding the weight implementation: that should be decided by the module maintainers.

summit’s picture

Hi Gerhard,

They have that already decided, see http://drupal.org/node/1363410#comment-5926806
So it can be ripped out. I do not know how to do this correct.

Greetings, Martijn

GStegemann’s picture

Hi Martijn,

no that's just a recommendation to users of the module and not a decision to change it.

Gerhard.

summit’s picture

OK, lets ask it Nancy then!
EDIT: I asked her in the head-thread: http://drupal.org/node/870846#comment-7381370
greetings, Martijn

GStegemann’s picture

Status: Active » Fixed

Fix committed.

Status: Fixed » Closed (fixed)

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