FLEXIcontent / flexicontent-cck

Advanced content management for Joomla
http://www.flexicontent.org
83 stars 53 forks source link

error after save update content if use Falang #964

Closed lungkao closed 4 years ago

lungkao commented 4 years ago

An error has occurred. 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ) AND i.language = '*' AND i.id <> 3' at line 1

and have Warning: trim() expects parameter 1 to be string, array given in /Applications/MAMP/htdocs/joomla39/components/com_flexicontent/models/category.php on line 1212

if use FaLang Language Switcher

Joomla! 3.9.13 Flexicontent 3.3.1.6 falang 3.2.0

ggppdk commented 4 years ago

I ll test Can you print the full SQL error ?

lungkao commented 4 years ago

I ll test Can you print the full SQL error ?

no error in log file

ggppdk commented 4 years ago
  1. Enable Joomla debug and you will get a function trace that shows which line created the SQL query and you can copy it here

  2. Then to be able to print the full SQL statement Find inside your template's error.php

    <?php if ($this->debug) : ?>
    <br/><?php echo htmlspecialchars($this->error->getFile(), ENT_QUOTES, 'UTF-8');?>:<?php echo $this->error->getLine(); ?>

    and after the above add (temporarily and then remove after you copy the SQL error)

    
    <?php if ($this->error instanceof JDatabaseExceptionExecuting) : ?>
        <br/><?php echo htmlspecialchars($this->error->getQuery(), ENT_QUOTES, 'UTF-8');?>
    <?php endif; ?>
lungkao commented 4 years ago

Error if use Edit inline

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ) AND i.language = '' AND i.id <> 1' at line 1 /Applications/MAMP/htdocs/joomla39/libraries/joomla/database/driver/mysqli.php:665 SELECT COUNT() FROM aid2j_flexicontent_items_tmp AS i JOIN aid2j_flexicontent_items_ext AS e ON i.id = e.item_id LEFT JOIN aid2j_flexicontent_cats_item_relations AS rel ON i.id = rel.itemid WHERE i.alias='2019-12-17-13-12-11-th-th' AND (i.catid=0 OR rel.catid IN () ) AND i.language = '*' AND i.id <> 1

lungkao commented 4 years ago

Screen Shot 2562-12-22 at 23 56 46

ggppdk commented 4 years ago

So this occurs in new item form , backend and frontend ?

lungkao commented 4 years ago

So this occurs in new item form , backend and frontend ? Both

ggppdk commented 4 years ago

Ok i think this is an easy fix, i will test and fix tomorrow morning, and ask you to test the fix too

ggppdk commented 4 years ago

Fixed with 998635d41

lungkao commented 4 years ago

Fixed with 998635d

Test pass . Thank you for hardwork