I seem unable to edit amazon_node nodes, it keeps yelling about the item already existing since it doesn't seem able to discriminate between adding a new item and editing an old. I propose a check is made whether the amazon item exists and if it does, it is overwritten.

Comments

Prometheus6’s picture

Assigned: Unassigned » Prometheus6

Are you working with version 4.7? The only thing you can edit is the book's rating. That's intentional, because amazon_node nodes should have nothing but data from Amazon.com.

Before I mark this 'by design," though, is there a reason I shouldn't?

solipsist’s picture

Using 4.7 yes. I tried to change the taxonomy term, that should be possible, shouldn't it?

Prometheus6’s picture

Yes, and is so on my systems, both php4 and php5. I'm not running release candidates, though.

If you have a url where I can see this problem, email me.

solipsist’s picture

I do, but thing was it happens when you click preview. I hadn't set previewing to optional so I was forced to preview, and trying to preview it caused the term selection to reset. Can you get that behavior to repeat?

Prometheus6’s picture

No, I can't.

You know what? I want you to email me a copy of the 4.6 and 4.7 versions of the module you're running. Right now, the ASIN field in the 4.6 version is manditory (check the form_textfield() call in amazon_form() );

function amazon_form(&$node, &$param) {
  if (function_exists('taxonomy_node_form')) {
    $output = implode('', taxonomy_node_form($node->type, $node));
  }
  $output .= form_textfield('ASIN', 'ASIN', $node->ASIN, 15, 15, 'Enter the ASIN of the book.', '', TRUE);
  if ($node->type == 'amazon') {
    $output .= form_textarea('Body', 'body', $node->body, 60, 20);
    $output .= filter_form('format', $node->format);
  }
  return $output;
}

in 4.7 it always was.

function amazon_form($node) {
  $form = array();
  if (is_null($node->nid)) {
  	$form['asin'] = array(
    	'#type' => 'textfield',
    	'#title' => t('ASIN'),
    	'#default_value' => $node->asin,
    	'#size' => 20,
    	'#maxlength' => 20,
    	'#description' => t('Enter the ASIN of the item with no spaces or punctuation.'),
     	'#required' => TRUE,
  	);
  }
  else {
  	$form['asin'] = array(
    	'#type' => 'value',
    	'#value' => $node->asin,
  	);
  }
  $form['rating'] = array(
    '#type' => 'select',
    '#title' => 'Rating',
    '#options' => explode(',', 'Unrated,' . variable_get('amazon_ratings_labels', 'Poor, Below average, Average, Above average, Excellent')),
  );

  if ($node->type == 'amazon') {
    $form['title'] = array(
      '#type' => 'textfield',
      '#title' => t('Title'),
      '#default_value' => $node->title,
      '#size' => 20,
     	'#required' => TRUE,
    );
    $form['body'] = array(
      '#type' => 'textarea',
      '#title' => t('Body'),
      '#default_value' => $node->body,
      '#cols' => 60,
      '#rows' => 20,
    );
  }
  $form['format'] = filter_form($node->format);
  return $form;
}

And I'm just not having the problems you are. I need to see exactly what you're working with.

Prometheus6’s picture

Priority: Normal » Critical

Okay, I duplicated the problem...kind of by accident, but I can do it at will. I think it qualifies as critical.

solipsist’s picture

Ok, good to hear that! Thanks for taking your time looking into it.

Prometheus6’s picture

Okay, try a fresh download. I'll wait for your response before setting this as fixed, of course.

Prometheus6’s picture

Status: Active » Fixed
solipsist’s picture

I haven´t had time to look at this yet but I will.

Prometheus6’s picture

Status: Fixed » Closed (fixed)