Keyword

Advanced Search

Search Results (Searched for: Re Error SQL)

  • wrina
  • wrina's Avatar
14 Feb 2017 18:49

Error - Image does not save to database

Category: English K2 Community

I have K2 v2.7.1 :: Joomla 3.6.5
SITE INFORMATION
OS Linux i
PHP 5.6.24
MySQLi 5.6.31
Caching Disabled
Gzip Disabled


I am not able to save images.
I have reviewed the fix located at: www.joomlaworks.net/forum/k2-en/45116-image-upload-error-k2-7-and-j3-5

My system file is not the same (see details below) I still have the problem.
How can i edit the item.php file to ensure images are saved to the database?? ::

CODING

//Image
if ((int)$params->get('imageMemoryLimit'))
{
ini_set('memory_limit', (int)$params->get('imageMemoryLimit').'M');
}
$existingImage = JRequest::getVar('existingImage');
if (($files == 0 || $existingImage) && !JRequest::getBool('del_image'))
{

if ($files == 0)
{
$image = $files;
}
else
{
$image = JPATH_SITE.DS.JPath::clean($existingImage);
}

$handle = new Upload($image);
$handle->allowed = array('image/*');
$handle->forbidden = array('image/tiff');

if ($handle->file_is_image && $handle->uploaded)
{
//Image params
$category = JTable::getInstance('K2Category', 'Table');
$category->load($row->catid);
$cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);

if ($cparams->get('inheritFrom'))
{
$masterCategoryID = $cparams->get('inheritFrom');
$query = "SELECT * FROM #__k2_categories WHERE id=".(int)$masterCategoryID;
$db->setQuery($query, 0, 1);
$masterCategory = $db->loadObject();
$cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
}

$params->merge($cparams);

//Original image
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'src';
$handle->image_convert = 'jpg';
$handle->jpeg_quality = 100;
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = md5("Image".$row->id);
$handle->Process($savepath);

$filename = $handle->file_dst_name_body;
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache';

//XLarge image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XL';
if (JRequest::getInt('itemImageXL'))
{
$imageWidth = JRequest::getInt('itemImageXL');
}
else
{
$imageWidth = $params->get('itemImageXL', '800');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);

//Large image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_L';
if (JRequest::getInt('itemImageL'))
{
$imageWidth = JRequest::getInt('itemImageL');
}
else
{
$imageWidth = $params->get('itemImageL', '600');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);

//Medium image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_M';
if (JRequest::getInt('itemImageM'))
{$imageWidth = JRequest::getInt('itemImageM');}
else
{
$imageWidth = $params->get('itemImageM', '400');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);

//Small image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_S';
if (JRequest::getInt('itemImageS'))
{
$imageWidth = JRequest::getInt('itemImageS');
}
else
{
$imageWidth = $params->get('itemImageS', '200');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);

//XSmall image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XS';
if (JRequest::getInt('itemImageXS'))
{
$imageWidth = JRequest::getInt('itemImageXS');
}
else
{
$imageWidth = $params->get('itemImageXS', '100');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);

//Generic image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_Generic';
$imageWidth = $params->get('itemImageGeneric', '300');
$handle->image_x = $imageWidth;
$handle->Process($savepath);

if ($files == 0)
$handle->Clean();

}
else
{
$mainframe->enqueueMessage(JText::_('K2_IMAGE_WAS_NOT_UPLOADED'), 'notice');
}

}

if (JRequest::getBool('del_image'))
{

$current = JTable::getInstance('K2Item', 'Table');
$current->load($row->id);
$filename = md5("Image".$current->id);

if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'src'.DS.$filename.'.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'src'.DS.$filename.'.jpg');
}

if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XS.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XS.jpg');
}

if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_S.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_S.jpg');
}

if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_M.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_M.jpg');
}

if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_L.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_L.jpg');
}

if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XL.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XL.jpg');
}

if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_Generic.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_Generic.jpg');
}

$row->image_caption = '';
$row->image_credits = '';

}
  • Aashir Khan
  • Aashir Khan's Avatar
02 Feb 2017 16:41
Replied by Aashir Khan on topic 0 Error decoding JSON data: Syntax Error

0 Error decoding JSON data: Syntax Error

Category: English K2 Community

I tried running your query like this [note my database prefix is 'jml3_']

SELECT * FROM `jml3_k2_items` SET `metadata` = 'robots=author=' WHERE `metadata` = '{"robots":"","author":"","rights":"","xreference":""}'

but I got the following message:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET `metadata` = 'robots=author=' WHERE `metadata` = '{"robots":"","author":"","' at line 1


I tried this query as suggested by someone else on the first page of this forum:

UPDATE `jml3_k2_items` SET `metadata` = ''

This one went through but in the SQL query page, but in Joomla in K2, the error message when opening any item didn't dissapear.

Finally, I tried changing the view.html.php file as suggested by Mohamed Abdelaziz on the first page, and that did work in removing the error message in K2 and allowing me to see my items. However, I fear that perhaps I might not be able to use metadata in my K2 items anymore by carrying out his solution. So I was wondering Concerto Designs LLC if you know why I'm getting this error message in the SQL query page when running your query with the correct database prefix?

Thanks!
  • Carlos Martin
  • Carlos Martin's Avatar
19 Jan 2017 18:01
Installing k2 in azure SQL server was created by Carlos Martin

Installing k2 in azure SQL server

Category: English K2 Community

Good day!

We're in the process of mgirating our joomla website to a more robust server in microsoft's azure cloud services.
Since we can't use our regular migration method (create a backup with akeeba backup and restore in the final server) I've been tasked with doing the migration manually.

When I attempted to install the latest k2 release (2.7.0), I get the following errors:
JInstaller: :Install: Can't find Joomla XML setup file.
JInstaller: :Install: Can't find XML setup file.
[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near '`'. SQL=ALTER TABLE #__k2_categories ADD `language` CHAR(7) NOT NULL

I'm not sure how to proceed here. Is there a way that we can install k2 in microsoft's azure database? Or is it better to find a similar component?

Thanks in advance
  • Giulia Magnesa
  • Giulia Magnesa's Avatar
16 Jan 2017 18:26 - 16 Jan 2017 18:28
import tables in new K2 was created by Giulia Magnesa

import tables in new K2

Category: English K2 Community

Hi
i'm upgrading an old W2 website (Joomla 1.5.x) to the last version.
I'm starting with a new installation and I want to import the K2 tables in the new db.
I have seen the K2 items table structure is different between the 2 versions. So I cannot use the old table as it is (I get a SQL error)

What is the right procedure to import the data of old tables in a new ones


thank you
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
09 Jan 2017 15:23
Replied by Krikor Boghossian on topic SQL Error for Existing Item

SQL Error for Existing Item

Category: English K2 Community

Hello,

Try clearing your site's cache.
If that does not do the trick, try repairing your db's tables.
  • Blabber
  • Blabber's Avatar
08 Jan 2017 18:42
SQL Error for Existing Item was created by Blabber

SQL Error for Existing Item

Category: English K2 Community

All of a sudden my users are getting the following error for an item that does exist:

126
Incorrect key file for table './blabber9_joom1/#__k2_items.MYI'; try to repair it SQL=UPDATE #__k2_items SET `hits` = (`hits` + 1) WHERE `id` = '75124'
It appears the page you were looking for doesn't exist. Sorry about that.

Does anyone know what it is and or how to repair it?

Thanks!
  • ale
  • ale's Avatar
20 Dec 2016 18:16

Extrafield error 1054 when word start with 'inf'

Category: English K2 Community

Hallo
The extrafield in k2 generate the error "1054" when insert any word that start with "inf" eg: "information, info@", "infact" ecc. in input text, textarea, ecc.
Unknown column 'INF' in 'field list' SQL=INSERT IGNORE INTO #__k2_searcher VALUES(978,81,'inf','81_ee7b630995e7a36b6420696989441e2d',INF,'*',0)

DB Version: 5.7.16-0ubuntu0.16.04.1
PHP Version: 7.0.8-0ubuntu0.16.04.3
Web Server: Apache/2.4.18 (Ubuntu)

Many tnx!
  • kin hua
  • kin hua's Avatar
29 Nov 2016 11:37
Quick Package Installation Problem was created by kin hua

Quick Package Installation Problem

Category: Free Joomla Templates

Could use some help here, while installing the Takai Quick Package, I keep getting this error :

HTTP Request Error
HTTP Status: 500 (Internal Server Error)
Internal status: error
XHR ReadyState: 4
Raw server response:

Server info (All with default settings):
Windows 2003
MySQL 5.6.27
PHP 5.4.45
Base Joomla 3.2.0
Apache 2.4

Appreciate any help, thanks.
  • Francis Rozange
  • Francis Rozange's Avatar
28 Nov 2016 22:13
Cant use extra fields was created by Francis Rozange

Cant use extra fields

Category: English K2 Community

when I click on extra fields button I have this error message: __k2_extra_fields' doesn't exist SQL=SELECT COUNT(*) FROM #__k2_extra_fields WHERE id>0 AND published=1
  • Joel Daspet
  • Joel Daspet's Avatar
21 Nov 2016 20:59
Error 1064 for k2 tags was created by Joel Daspet

Error 1064 for k2 tags

Category: English K2 Community

Hi everyall, i'm sorry but i dont speack english verry well (i'm french)

I come because i ave problème with my site. When i whant click on tag in k2 content, a message come with error 1064. This is the message :

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 '' at line 1 SQL=SELECT * FROM #__k2_categories WHERE id=

Can you help me ?
Thank's.

ps: exemple of problème
tag on the bottom of content :
www.actugame.net/actu-jeux-video/1019-final-fantasy-xv-les-details-du-patch-day-one

résult after clicking :
www.actugame.net/actu-jeux-video/tag/PS4
  • Joel Daspet
  • Joel Daspet's Avatar
21 Nov 2016 17:38
erreur 1064 sur tag k2 was created by Joel Daspet

erreur 1064 sur tag k2

Category: Communauté française K2

Bonjour à tous, je viens vers vous pour vous exposer mon problème, sachant que je suis novice et que le code n'est vraiment pas mon truc...



Depuis quelques temps, je me retrouve avec une erreur sql si je clique sur les tags rentrés dans mes articles (composant k2) sur mon site joomla.

exemple de page ici :

www.actugame.net/les-vid%C3%A9os/tag/microsoft



le message :

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 '' at line 1 SQL=SELECT * FROM #__k2_categories WHERE id=

Si vous avez une idée de solution je suis prenneur car là, je suis largué. Merci de vulgariser au maximum pour mes pauvres compétences. :)
  • smarterweb
  • smarterweb's Avatar
14 Nov 2016 02:26
Replied by smarterweb on topic 0 Error decoding JSON data: Syntax Error

0 Error decoding JSON data: Syntax Error

Category: English K2 Community

we had the same issue, but only after importing Joomla articles into K2. Seems there is leftover metadata that creates the problem.
A solution is to clear the column "metadata" in k2 table "k2_items" here's the sql query:

UPDATE `tableprefix_k2_items` SET `metadata` = ''

NOTE: You will of course loose your metadata if there was any.
  • Zoe
  • Zoe's Avatar
02 Nov 2016 16:51 - 02 Nov 2016 16:56

0 Error decoding JSON data: Syntax Error

Category: English K2 Community

Hello Krikor,

Thanks for the link to the JoomlaShack topic, I checked it. update [prefix]_modules set params="" WHERE params = "{"\"\"}";
is the first thing I did. I got a return of 0 rows updated.

I saw further down in the Github conversation that it was argued this is not a Joomla core issue and it is an extensions issue to do with the extensions not being able to handle this higher level of error handling, if I've understood it correctly.

I have also implemented the #116713 solution and defined the following in the top of my index.php file:

unset($this->_scripts[JURI::root(true).'/components/com_k2/js/k2.js?v2.7.1&sitepath='.JURI::root(true).'/']);

And I'm still getting the error. I thought disabling the javascript would resolve the JSON error? Am I wrong?

I have currently resorted to deleting the old K2 items and replacing them with new ones (after copying the content directly out from the SQL) this works but it is far from an ideal solution.

Any ideas?
  • Manfred-Marieke Van de Waarsenburg
  • Manfred-Marieke Van de Waarsenburg's Avatar
28 Sep 2016 22:12
Error 1146 when saving new item was created by Manfred-Marieke Van de Waarsenburg

Error 1146 when saving new item

Category: English K2 Community

Dear All,

I hope someone can tell me whats goes wrong.
When i Save a new item i got the following error message

Error 1146 :
Table 'groenpo_jos1.joox_k2_tags_xref' doesn't exist SQL=SELECT tr.id, tr.itemID, tr.tagId, t.name FROM joox_k2_tags_xref AS tr INNER JOIN joox_k2_tags AS t ON t.id = tr.tagID WHERE t.published = 1 AND tr.itemID = 12

You may not be able to visit this page because of:
an out-of-date bookmark/favourite
a search engine that has an out-of-date listing for this site
a mistyped address
you have no access to this page
The requested resource was not found.
An error has occurred while processing your request.

I see there is some problem with de Dbase, but i doesn't know how to solve

Please tell me what to do.

Grtz From holland
Manfred vd Waarsenburg
  • Steven Trooster
  • Steven Trooster's Avatar
27 Sep 2016 21:59
Replied by Steven Trooster on topic What Happened to K2 3.0?

What Happened to K2 3.0?

Category: English K2 Community

Though there were some updates, these were only admin interface changes. The really much anticipated version 3, which I've tested, is far from production ready, and doesn't have the much needed feature improvements. Judging from the activity on GitHub (and the participation of the developers in this discussion), I don't think there will be a 3.0 version any time soon.

I've looking into alternatives. Seblod I couldn't get installed. A lot of install sql-errors. Zoo, out of the box seems really complex to set up.
I've found EasyBlog a really fantastic option, which I'm investigating into detail. It has a K2 migration tool and lots of features that are either missing or only available with (commercial) third party plugins for K2. And very good support.
  • Pinto Buck
  • Pinto Buck's Avatar
16 Sep 2016 17:26

K2 broke Gantry 5 template animation. Uninstall broke mysql

Category: English K2 Community

Info update:

1) Swiffy Animations -- I think you are right that K2 and Swiffy animations have a Javascript conflict. When both are installed they may cause a recursion problem. Later, I found out that this also happens with Swiffy animations and Rockettheme's Roksprocket extension. My solution is that I just cannot use Swiffy animations with certain Joomla extensions.

2) Fatal error: Cannot redeclare pma_tableheader() -- I now believe that this a bug in myAdminPHP. I posted the issue in Github. github.com/phpmyadmin/phpmyadmin/issues/12558 . I also opened a support ticket with my web hosting service to update their version of myAdminPHP.

3) "Problems with indexes of table `tbl_user_keys`
The indexes series and series_3 seem to be equal and one of them could possibly be removed.
The indexes series and series_2 seem to be equal and one of them could possibly be removed."
I followed the error message's advice and dropped table rows for index series_3 and series_2, which solved the problem.

Summary:
In my initial post, I assumed that all of these issues were caused by K2 because I had just installed and uninstalled K2 when I noticed the problems.
Now, I think that it was just coincidence, and I apologize for putting the blame on K2. If you concur, we could marked this issue as resolved. Thank you for replying and helping.
  • davidvicky
  • davidvicky's Avatar
07 Sep 2016 07:57 - 08 Sep 2016 11:45
K2 Database Error limit was created by davidvicky

K2 Database Error limit

Category: English K2 Community

hello

Kindly need your help in fixing the K2 Database Error.

1146 Table 'tis_careers.#__k2_log' doesn't exist SQL=SELECT * FROM #__k2_log LIMIT 0, 1

Regards guy
  • Fábio Jordan
  • Fábio Jordan's Avatar
31 Aug 2016 00:06
Force logout of another Administrator was created by Fábio Jordan

Force logout of another Administrator

Category: English K2 Community

Hi there.

I have a suggestion. What about inserting an option to a Super Admin (and only that group) force logout of another administratror?

Sometimes, it happens that a user let it browser openned, but he is not editing an item that the created. But then, it's necessary that another person edit that item, but the backend says it's not possible, because someone is working on that article.

I've tried to block another administrator, so the backend would let me edit the specific item, but this didn't work. Btw, I even got this error:

Table 'cafe.#__user_keys' doesn't exist SQL=DELETE FROM `#__user_keys` WHERE `user_id` = 'cavanha'

Maybe something is broken, and because of this I can't block the user (what should force the logout). So, I've tried to change the user group, and then, again, nothing happens (the backend doesn't check if the user, after logged, is an administrator). I also tried to block the user via K2 User Settings, but nothing works.

I know that after a specific period of time, token will expire, but it would be nice to solve this with a simple option.

Any help?

Thanks in advance!
  • GBpilot Man
  • GBpilot Man's Avatar
30 Aug 2016 19:23
Replied by GBpilot Man on topic K2Model Error - Still

K2Model Error - Still

Category: English K2 Community

Krikor wrote: It does actually, like other CMSs it will play nicely with other db's (like SQLServer) but MySQLi is recommended.

Since Joomla! is an application driven CMS, unlike WP or Drupal which are node-based CMSs, you rely heavily on 3rd party extensions so you need to use the recommended database.


I guess that's what caused the confusion. Both Drupal and Joomla support PostgreSQL databases - it's listed in the specs. However, with Drupal the modules/extensions evidently did not see the database directly as the worked with either database when I used them. All you did was install them. Since Joomal! listed PosgreSQL as a supported database and being new to it I assumed you could just use based on my Drupal experience. Now I know different and I'll have to keep that in mind. It's part of the learning curve.

Thanks for the help.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
30 Aug 2016 14:48
Replied by Krikor Boghossian on topic K2Model Error - Still

K2Model Error - Still

Category: English K2 Community

It does actually, like other CMSs it will play nicely with other db's (like SQLServer) but MySQLi is recommended.

Since Joomla! is an application driven CMS, unlike WP or Drupal which are node-based CMSs, you rely heavily on 3rd party extensions so you need to use the recommended database.
Displaying 101 - 120 out of 789 results.

Powered by Kunena Forum