View Issue Details

IDProjectCategoryView StatusLast Update
0003163OXID eShop (all versions)4.07. Source code, Testpublic2012-12-10 13:44
Reportercsimon Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Summary0003163: Impossible to use admin without views
DescriptionAccording some bug entry regarding mysql and views, it was suggested to dump a database without views and regenerate them in admin afterwards.

However: This is impossible because there is an error when you try to open admin without having views:

" exception 'ADODB_Exception' with message 'mysql error: [1146:xxxxxxxx.oxv_oxcountry_en' doesn't exist]"

There has to be a possibility to regenerate views without admin whatsoever.

However, since shopowners aren't programmers i suggest to provide a small script somewhere which only calls "updateViews" on oxDb. Maybe there could be an "emergency" admin which oxchkversion and scripts like this. the decision is yours.

I attached a small script which is only quick and dirty and of course allowed to adapt ;)
Steps To ReproduceDelete views -> try to open admin
TagsNo tags attached.
Attached Files
tc_update_views.php (356 bytes)   
<?php

function getShopBasePath() {
    return dirname(__FILE__) . '/';
}

function isAdmin() {
    return false;
}

// custom functions file
include getShopBasePath() . 'modules/functions.php';

// Generic utility method file
require_once getShopBasePath() . 'core/oxfunctions.php';

$config = oxConfig::getInstance();

oxDb::getInstance()->updateViews();
tc_update_views.php (356 bytes)   
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Relationships

related to 0002743 resolvedalfonsas_cirtautas mysqldump does not work with many languages 

Activities

dainius.bigelis

2011-08-24 12:59

reporter   ~0005095

We will discuss internaly about the best way to solve it and how to deliver that kind of solutions (as separate scripts or with eShop with restricted access, etc.). Having in mind that in future this tool may contain also other features for rescue actions (like disabling modules or so).

ray

2011-09-06 08:26

reporter   ~0005177

You know about the script provided in forums to edit module emtries via frontend?

http://wiki.oxidforge.org/Tutorials/en/edit-Module-entries-via-Frontend

leofonic

2011-09-06 15:57

reporter   ~0005184

This maybe some module causing this, i recreated views in admin several times without problems. However, an "emergency admin" is a very good idea.

csimon

2011-09-26 08:20

reporter   ~0005261

leofonic could be right, if some module is selecting a view from database - which is always the case if you use getSelectFields or getViewName - which extends a class which is loaded in admin (e.g. oxuser) then the admin is unusable.

however, i think some kind of "safe-mode" which can be enabled in config.inc.php would be neat, even if this is not really a "bug" :)

Linas Kukulskis

2012-12-03 14:25

reporter   ~0008042

use config option blSkipViewUsage in config.inc.php
add it to config file, set value true
login to admin regenerate view
remove config option