A whole view disappears I have deployed user generated views to a production site using Views (6.x-2.12) bulk export feature; that is, views are saved in the code as mymodule.module and mymodule.views_default.inc, the latter of which contains 12 views in more than 11,000 lines.

Sometimes, one or more views suddenly disappear from the site. Flushing all caches usually fixes it, but it is hard to duplicate the issue and it bothers me that it may happen again in the worst time.

Possible causes that I think of are:


Does the .inc file have too many lines (> 11K)?
I have saved the .inc file with Windows new lines, while the server is Linux.


Could one of these be the cause?
Anyone experienced a similar issue?
Solution for the "to many lines" problem:

function YOURMODULE_views_default_views() {
    $files = file_scan_directory((drupal_get_path('module','YOURMODULE').'/views','.view'));
    foreach($files as $absolute =&gt; $file) {
        require $absolute;
        if(isset($view)) {
            $views[$view-&gt;name] = $view;
        }
    }
    return $views;
}


This way every view-code can be stored in it's own file inside a views subfolder inside YOURMODULE as some_name.view.