I am opening this thread (probably) closely related to the following issue:
https://www.drupal.org/node/1300848

Symptoms: After some time created webforms disappear - the rest of the node / webpage is rendered correctly, just webform is missing. After flushing the cache, webforms reappear. But after some time, they disappear again.

Also, when I click on the Webform tab, display is broken (see the screenshot).

The following Notices and Warnings are also present:

Notice: Undefined property: stdClass::$webform in webform_components_form() (line 56 of /sites/all/modules/webform/includes/webform.components.inc).

Warning: Invalid argument supplied for foreach() in webform_components_form() (line 56 of /sites/all/modules/webform/includes/webform.components.inc).

Notice: Undefined property: stdClass::$webform in webform_components_form() (line 109 of /sites/all/modules/webform/includes/webform.components.inc).

Notice: Undefined property: stdClass::$webform in webform_components_form() (line 145 of /sites/all/modules/webform/includes/webform.components.inc).

-----
Drupal 7.34, sub theme of Bartik 7.34

Any help is appreciated. Thank you very much.

Comments

danchadwick’s picture

What caching are you using?

Is this on the webform node page or are you displaying the webform in a block? Panels?

There is something different about your installation from the tens or hundreds of thousands of sites which are running without this issue. We (which really means you) need to figure out what's triggering this issue.

It seems that the webform is not present in the node for some reason. I think you'll need to debug to figure out why.

danchadwick’s picture

Status: Active » Postponed (maintainer needs more info)
Ivan Ottinger’s picture

Thank you Dan.

The website doesn't use any special caching - even all built-in caching options are turned off (admin/config/development/performance).

The problem occurs on both - node page and block. Also panels are installed and I tried to use them to display the webform block, but the same thing happens.

Would any other information be useful?

I am not sure what is causing this issue and don't know where to look for the problem.

danchadwick’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Fixed

Something is wrong or incompatible with your installation. If this were a common issue in webform, we'd have hundreds of complaints. It could be some module which isn't compatible with webform. It could be some problem with updating, although I doubt it.

The notices in your log are related to viewing the components tab of a webform. If you can reproduce that in your development environment, you can backtrack to see why the webform components weren't loaded. It's almost like the content type is no longer set to include a webform.

If you don't have the debugging skills, I'm afraid you may have to hire a developer. Without more information, there isn't much I can do to help from here. Please re-open if you have more info for me to try to use to help.

Status: Fixed » Closed (fixed)

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

rabijaved’s picture

I have the exact same issue.
I updated drupal, php, and webform module to the latest versions. It did not help.
The drupal log does not show any error. The only thing that makes the webform section of the page reappear is clearing the cache. I tried disabling caching but this did not help and still requires the cache to be cleared for webform to reappear.
The issue persisted with version 7.x-3.24 and 7.x-4.10 of the webform. If anyone came up with a solution, please let me know.

mariskath’s picture

I'm not sure this will help, but I had a similar problem. It turned out that I checked that a user could only submit the form once. I thought that when a user would submit the form for a second time, (s)he would get a message saying that (s)he has already submitted the form. But instead the form disappeared when a user submitted the form. Since I didn't expect this, it took me some time to find out that this was the problem.

It works fine now.

Hope this will help someone,
Mariska.

Tyera’s picture

I am experiencing this same problem. Did anyone find a solution?

mennonot’s picture

Status: Closed (fixed) » Active

I just encountered this same problem on a client's website: they contacted me to say that all the webform components had disappeared across multiple webforms. The body field was still visible at the top of the page, but no components were visible. When I clicked the edit webform tab, I got the "No Components, add a component below." message. I found the predecessor issue to this one (https://www.drupal.org/node/1300848) and tried the solution of clearing the cache (via the "flush all caches" menu item). The components reappeared immediately.

This issue did not occur in our development environment running nearly identical code. Because the issue occurred on their production server, the top priority was to get it resolved, so I did not gather much data before flushing the caches. If the issue reoccurs I will try to get more information about it. If it occurs on the dev site, then we would have more flexibility to gather more information.

Given that Tyera reports this same issue occurring earlier today in comment #8 above, I went ahead and re-opened the issue.

Tyera’s picture

To be more explicit:

After posting yesterday, I updated my version of Drupal and installed fresh copy of Webform. But am seeing the issue again.
Mine is identical to the original poster: Webform fields disappear from Webform node pages (I have 2 currently), and clicking on the Webform tab in admin presents the "Undefined property" error messages.

Clearing the site cache restores the form fields and removes the error messages.

deadpoet’s picture

I have this issue as well. After adding some conditionals to my webform and changing some of the form settings and saving, all of the form fields and form settings disappeared and reset back to default and blank.

Clearing the Drupal cache fixed the problem, temporarily, but it reoccurred again after doing some edits. Very strange.

(I'm not getting any error messages though. My form is unpublished as it is still being worked on and isn't ready to go live)

bigbert’s picture

hi, I just find the same issue, exactly as described by Ivan last year. Does anyone has found any solution please??

hockey2112’s picture

I, too, experienced this issue today. Log messages:

Warning: Invalid argument supplied for foreach() in webform_component_edit_form_validate() (line 638 of /home/mysite/public_html/sites/all/modules/webform/includes/webform.components.inc).

Notice: Undefined property: stdClass::$webform in webform_ensure_record() (line 4060 of /home/mysite/public_html/sites/all/modules/webform/webform.module).

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3' for key 'PRIMARY': INSERT INTO {webform} (nid, next_serial, confirmation, confirmation_format, redirect_url, status, block, allow_draft, auto_save, submit_notice, confidential, submit_text, submit_limit, submit_interval, total_submit_limit, total_submit_interval, progressbar_bar, progressbar_page_number, progressbar_percent, progressbar_pagebreak_labels, progressbar_include_confirmation, progressbar_label_first, progressbar_label_confirmation, preview, preview_next_button_label, preview_prev_button_label, preview_title, preview_message, preview_message_format, preview_excluded_components) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23, :db_insert_placeholder_24, :db_insert_placeholder_25, :db_insert_placeholder_26, :db_insert_placeholder_27, :db_insert_placeholder_28, :db_insert_placeholder_29); Array ( [:db_insert_placeholder_0] => 3 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => 0 [:db_insert_placeholder_9] => 1 [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => [:db_insert_placeholder_12] => -1 [:db_insert_placeholder_13] => -1 [:db_insert_placeholder_14] => -1 [:db_insert_placeholder_15] => -1 [:db_insert_placeholder_16] => 1 [:db_insert_placeholder_17] => 0 [:db_insert_placeholder_18] => 0 [:db_insert_placeholder_19] => 1 [:db_insert_placeholder_20] => 1 [:db_insert_placeholder_21] => Start [:db_insert_placeholder_22] => Complete [:db_insert_placeholder_23] => 0 [:db_insert_placeholder_24] => [:db_insert_placeholder_25] => [:db_insert_placeholder_26] => [:db_insert_placeholder_27] => [:db_insert_placeholder_28] => [:db_insert_placeholder_29] => ) in drupal_write_record() (line 7334 of /home/mysite/public_html/includes/common.inc).

ericamp’s picture

Version: 7.x-4.2 » 7.x-4.12

Same issue, exactly as described by Ivan.
No change if the webform is a node page or displaying in a block.

ericamp’s picture

Category: Support request » Bug report

Some details:
- public webform
- no cache
- no limit to form submissions
- indifferent if webform is a node page or displaying in a block

The webform perfectly works and no change has been made. After 2 days the webform disappears, no error in log, and cache clear is needed to make it reappear.

ericamp’s picture

The problem seems to be solved by setting values (other then none) of "Minimun cache lifetime" and "Expiration of cached pages" in Drupal performance configuration page.

ericamp’s picture

Unfortunately today the problem of fields disappearing is present again. The settings of "Minimun cache lifetime" and "Expiration of cached pages" in Drupal performance configuration page is not sufficient to solve the anomaly.

ElineK’s picture

Hey,

I had the same problem and i may have a solution.
It turned out to be a silly/stupid mistake on my behalf in the form's settings.
Check your submission limit (form node > webform > form settings > total submission limit)
I had it a limited amount/day and when that number was reached, the form would disappear.

So maybe this can help someone not make the same stupid mistake as i did

greetings

island_guy’s picture

Hey,

I was having this problem. The cause was that I was running two sites off the same database.

See RiverDonkey's comment here:
https://www.drupal.org/node/1300848#comment-5311126

Anonymous’s picture

Me too have this issue in webform 4.12.

The form appears only after clearing caches. Even though I have cronjobs for clearing caches and cron from time to time, the webform components used to disappear sometimes.

I thought I solved this with custom module below, but it doesn't work. As hook_init() doesn't run on cached pages. From hook_init() api page:

This hook is not run on cached pages.

<?php
/*
 * hook_init()
 */
function MYMODULE_init() {
        if(current_path() == "node/NID") {
                drupal_flush_all_caches();
        }
}

Edit: Edited to inform the above solution doesn't work.

liam morland’s picture

Does this still happen in the latest version of Webform?

Anonymous’s picture

Yes it does, I tested by updating it to latest stable version 4.15 and also the dev version.

BTW This is really hard to reproduce and needs lots of patience, the webform components disappears around 5 times in 100 manual refreshes. It took me more than 2 hours of pressing f5 to reproduce it again when testing with 4.15 and --dev version.

This is not something that occurs every time but maybe when cache is matured, as there is absolutely no error/warning/notice message in log (not just drupal log but also php/nginx/mysql logs) related to it and the component is shown only after clearing all caches.

math-hew’s picture

I'm experiencing this issue now on a D7 site. Can't find anything in the issue queue that addresses it aside from this thread and the one that preceded it. Like the others who are experiencing it, the form components reappear when I flush the cache.

anni’s picture

Sadly same problem here.

liam morland’s picture

Version: 7.x-4.12 » 7.x-4.x-dev
Parent issue: » #1300848: Bootstrap cache causes webform to disappear

Are you seeing the same warnings and notices as in the issue description? Who else is still having this problem? Is it reproducible? When it happens, what are the content of cache-related HTTP response headers like x-drupal-cache, x-cache, and x-cache-hits? Once it disappears, does it stay that way? If so, you can add debugging statements to start to track down where the failure is.

stellarvisions’s picture

I am having this issue also with quite a few D7 sites.

stellarvisions’s picture

I have been having an issue with cron on my server, I wonder whether this is related . . .

liam morland’s picture

It could be. Are others with this problem having cron issues as well?

liam morland’s picture

Status: Active » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.