Coroico / AdvSearch

Dynamic content search add-on for MODx Revolution that supports results highlighting, faceted search and search in custom packages
21 stars 14 forks source link

use default modx-table-prefix if not set a custom-prefix #57

Closed Bruno17 closed 10 years ago

goldsky commented 10 years ago

how about this instead:

            $this->queryHook['main']['packagePath'] = str_replace($pattern, $replacement, $this->queryHook['main']['packagePath']);

            $tablePrefix = isset($this->queryHook['main']['tablePrefix']) ? $this->queryHook['main']['tablePrefix'] : $this->modx->config[modX::OPT_TABLE_PREFIX] . $this->queryHook['main']['package'] . '_';
            $added = $this->modx->addPackage($this->queryHook['main']['package'], $this->queryHook['main']['packagePath'], $tablePrefix); // add package
            if (!$added) {
                return false;
            }

            $this->primaryKey = $this->modx->getPK($this->mainClass); // get primary key

So the default would be 'modxpackage'

Bruno17 commented 10 years ago

the default should stay with OPT_TABLE_PREFIX , nothing additional everything, which is different from OPT_TABLE_PREFIX is a Custom-prefix, IMO