FluidTYPO3 / vhs

TYPO3 extension VHS: Fluid ViewHelpers
https://fluidtypo3.org
Other
189 stars 228 forks source link

PostgreSQL Support #1682

Open trokohl opened 4 years ago

trokohl commented 4 years ago

Hi,

vhs uses sql condition which are not compatible with postgreSQL. The colume name must be quoted (https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS) to work with postgre and mysql.

(Quick) Fix; Classes/ViewHelpers/Content/AbstractContentViewHelper line 149 - 154

        if (is_numeric($this->arguments['column'])) {
            $conditions = sprintf('"colPos" = %d', (integer) $this->arguments['column']);
        }
        if (true === (boolean) $this->arguments['sectionIndexOnly']) {
            $conditions .= ' AND "sectionIndex" = 1';
        }

If you use colPos without quotes postgre search the column colpos (in lowercase).