Creating article or simple page produces this message on top of the page:

Notice: Undefined property: stdClass::$isbn2node_author in isbn2node_node_submit() (line 384 of
/Library/Server/Web/Data/Sites/drupal/sites/all/modules/ISBN2node/isbn2node.module).

However creating or saving a ISBN2node does not produce this message.

CommentFileSizeAuthor
#3 ISBN2Node-save-error-1537468.patch962 bytesjwalz

Comments

woodhous@email.unc.edu’s picture

I am having the same problem. Is there a resolution?

vertikal.dk’s picture

Folks,

Sorry about the late reply, but due to health issues I'm not as active as I used to be.

The error looks like a warning about an undeclared variable in the node submission process, and this variable ($isbn2node_author) should of course only come into play when we save a node of the isbn2node content type. Looks like sloppy validation or type checking on my hand. I will look into it.

Martin

jwalz’s picture

Status: Active » Needs review
StatusFileSize
new962 bytes

I'm not sure if the patches that I'm posting will make things easier for you, but since I'm fixing things for my install I figured I'd post them here.

learningalchemy’s picture

Having same issue - have other folks had success with this patch?

monsoon’s picture

same issue here...

rohit11’s picture

following Error occour when any node save rather then ISBN2node "Notice: Undefined property: stdClass::$isbn2node_author in isbn2node_node_submit() "

Please suggest solution... thanx

juahoo’s picture

This patch worked for me, thanks.

kwerey’s picture

Issue summary: View changes

Thanks jwalz!

Everyone having the same issue: yes, that patch will help. The error is because that isbn2node_submit function is being called when any type of node is submitted, so when you make a new page or article or whatever it tries to find the isbn2node_author field and gets confused and throws an error message when it can't see one.

This patch just adds a check to verify that the isbn2node_author field exists BEFORE trying to get rid of stray punctuation. If you go take a look which line the error message tells you there's an undefined property and carefully add that if-statement in. It should end up looking like this:


function isbn2node_node_submit($node) {
  // Remove trailing commas from author field before submission<strong>
  if (property_exists($node, 'isbn2node_author')) {</strong>
      $node->isbn2node_author['und']['0']['value'] = rtrim(trim($node->isbn2node_author['und']['0']['value']), ',');
    }
  return $node;
}
kwerey’s picture

Status: Needs review » Reviewed & tested by the community

The suggested patch has been used successfully by multiple end users.