Split off from #903420: PHP notices in HS Taxonomy & HS - especially when running pressflow, this is an annoying notice popping up on a lot of occasions (especially with forms of course).
Very easy no brainer patch.

Comments

swentel’s picture

StatusFileSize
new547 bytes

Updated patch from root dir of Drupal and removing the other whitspace lines.

Status: Needs review » Needs work

The last submitted patch, form_notice.patch, failed testing.

Raf’s picture

Any progress? I'm having this on Pressflow as well (along with some other bugs)

vectoroc’s picture

Status: Needs work » Needs review
StatusFileSize
new432 bytes

just corrected a bit the patch

vectoroc’s picture

StatusFileSize
new432 bytes

again

Status: Needs review » Needs work

The last submitted patch, form_notice_1.patch, failed testing.

damien tournoud’s picture

Status: Needs work » Postponed (maintainer needs more info)

Can you elaborate on why you feel this is necessary? There is no reason for #post not to be defined.

vectoroc’s picture

Because it produces a lot of notices in error_reporting(E_ALL) mode.
Perhaps it's an HS issue. I didnt investigate it deeply.

mikeytown2’s picture

subscribe from pressflow. Something like this would probably be better.

if (isset($form['#post'])) {
  $form[$key]['#post'] = $form['#post'];
}
mikeytown2’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.58 KB

Setting to needs review for the testbot. Once it passes will switch this issue over to hierarchical select so we can come up with a proper fix in that module.

mikeytown2’s picture

Project: Drupal core » Hierarchical Select
Version: 6.x-dev » 6.x-3.x-dev
Component: forms system » Code

Patch above was green before moving this to the HS issue queue.
I believe the root issue is somewhere in the HS code base; thus I'm moving this issue into this project.

penyaskito’s picture

Having the same issue, the problem is on hierarchical_select.module, line 690:

  // This prevents values from in $element['#post'] to be used instead of the
  // generated default values (#default_value).
  // For example: $element['hierarchical_select']['selects']['0']['#default_value']
  // is set to 'label_0' after an "Add" operation. When $element['#post'] is
  // NOT unset, the corresponding value in $element['#post'] will be used
  // instead of the default value that was set. This is undesired behavior.
  if (isset($element['#post'])) {
    unset($element['#post']);  
  }

Removing this piece removes the problem, but I don't fully understand the implications.

penyaskito’s picture

Status: Needs review » Needs work

OK, if I have understood the comment in code, the #post values where used instead of the #default_value.

If I remove this code, and load an edit form of a node with a hierarchical select, values are correctly set, so maybe those lines are not needed anymore?

penyaskito’s picture

StatusFileSize
new717 bytes

Adding a patch.

gold’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Tidying up the issue queue. The 6.x version is no longer supported. Only reopen this if it also applies to the 7.x.