After the installation of 'Webform 7.x-3.13 (2011-Aug-31)' I get the following PHP error message:

Notice: Undefined index: private in _webform_client_form_rule_check() (Zeile 1918 von /var/www/drupal7/sites/all/modules/contrib/webform/webform.module).

webform.module

1917:  // Private component?
1918:  if ($component['extra']['private']) {
1919:    $show_component = webform_results_access($node);
1917:  }

I've had a ~5 month break from Drupal7, I am currently upgrading my multi-site & this is my first major bug since quite a time -- which means, I need to work myself into the whole thing again & cannot provide any solutions or proposals at the moment. Sorry. You probably get it straight away anyway, I guess -- but unfortunately my brain doesn't associate anything with 'private'.

Comments

vernond’s picture

Aye, the Private thing is new. Did this come up on an existing component on an existing form? I think it'll go away if you go into edit on the component and just save it again.

Blooniverse’s picture

... it occurs on the frontpage, where a webform is displayed in the region 'featured'. For the moment, I've commented in the above mentioned lines. This works, obviously, but even more obviously it is not a permanent solution :)

Blooniverse’s picture

... I've just tried your proposal in comment#1 (edited & saved the particular webform as a whole), but this doesn't eliminate the error.

vernond’s picture

You'd need to go into edit and save each of the components individually to add the private key to their saved configurations in the database. I never thought of this as part of the upgrade path, but perhaps I should knock together an extra bit that will add this key to all existing components to prevent the notices on existing forms.

BTW, your production site should be configured to not show php notices and warnings - you should be reading these in your logs rather than on-screen.

Blooniverse’s picture

... thanks, @vernond! Well, if you have enough time resources & you still feel healthy enough, then do it -- the community would be greatful for this 'altruistic deed'. But if go insane due to accumulating contrib module bug issue piles, then rather leave it probably :)

quicksketch’s picture

Priority: Major » Normal

I can't confirm this issue after upgrading an existing 7.x webform installation. Webform should prevent this error as long as all the component you're using have defined "private" => FALSE in their respective _webform_defaults_[component_name]() functions. As all the components that come with Webform include this, most likely the cause of this issue would be if you have a custom or add-on module that provides a component beyond the ones that Webform comes with. If so, you should contact the maintainer of that module and request that they add support for private/public component display.

quicksketch’s picture

To more accurately state that this shouldn't be necessary:

but perhaps I should knock together an extra bit that will add this key to all existing components to prevent the notices on existing forms.

The webform_component_defaults() function should already be providing all the defaults necessary, so an update hook is not needed. That's actually the exact reason that this function exists so we don't have to do update hooks or ugly !empty() or isset() checks all over the place. As you can see, it merges not only the top-level properties with defaults but also the "extra" properties:

function webform_component_defaults(&$component) {
  if ($defaults = webform_component_invoke($component['type'], 'defaults')) {
    foreach ($defaults as $key => $default) {
      if (!isset($component[$key])) {
        $component[$key] = $default;
      }
    }
    foreach ($defaults['extra'] as $extra => $default) {
      if (!isset($component['extra'][$extra])) {
        $component['extra'][$extra] = $default;
      }
    }
    $component['extra'] += array(
      'conditional_component' => '',
      'conditional_operator' => '=',
      'conditional_values' => '',
    );
  }
}

So all told I think that some component @the_phi is using is "non-standard" (not included with the core Webform project), and it just needs to be updated to set a default in its _webform_defaults_[component_name]() function.

quicksketch’s picture

Oh, and of course if you haven't tried already clearing your Drupal caches might also help, especially if you have the Entity Cache module enabled.

quicksketch’s picture

Status: Active » Closed (cannot reproduce)

I'm fairly sure this has either been fixed or was a use-case specific issue. We haven't had any confirming reports.

quicksketch’s picture

Issue summary: View changes

(ps) path changed.