Save failed with the following error: Unknown column '*' in 'field list' Topic is solved

General questions relating to Joomla! 3.x.
Post Reply
vinushi
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Feb 14, 2019 8:34 am

Save failed with the following error: Unknown column '*' in 'field list'

Post by vinushi » Tue Sep 15, 2020 6:11 am

In my joomla website, when I try to save article it shows "Save failed with the following error: Unknown column '*' in 'field list". Furthermore same issue displayed when i try to change the menu item and after clicking save button. I checked database manager, it hasn't any error, Database table structure is up to date. Please give instruction to fix that problem. Joomla version - 3.9.8
You do not have the required permissions to view the files attached to this post.

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1823
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Save failed with the following error: Unknown column '*' in 'field list'

Post by SharkyKZ » Tue Sep 15, 2020 7:30 am

The issue is in Content - Notify plugin.

vinushi
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Feb 14, 2019 8:34 am

Re: Save failed with the following error: Unknown column '*' in 'field list'

Post by vinushi » Tue Sep 15, 2020 10:42 am

Hi SharkyKZ,
How I fix that issue. I haven't any idea of that. Please help me..

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1823
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Save failed with the following error: Unknown column '*' in 'field list'

Post by SharkyKZ » Tue Sep 15, 2020 11:20 am

Disable the plugin? Or ask its developers. If the plugin is not maintained anymore, post the contents of plugins/content/notify/notify.php here so we can take a look and fix it.

vinushi
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Feb 14, 2019 8:34 am

Re: Save failed with the following error: Unknown column '*' in 'field list'

Post by vinushi » Wed Sep 16, 2020 5:29 am

Hi,
Here I have put the notify.php below. please look it and help.

Code: Select all

<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  System.p3p
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Joomla! P3P Header Plugin.
 *
 * @since  1.6
 * @deprecate  4.0  Obsolete
 */
class PlgContentNotify extends JPlugin
{
	function onContentAfterSave($context, $article, $isNew)
	{
		define('SERVER_API_KEY','AAAAF2MADiU:APA91bF7YyC0loOGZO6B4NPXWxAZit2jOQ30eOMvJg_CwlU1J6Qgw-z1mYwYXxb4Ib4l6fEoonxjlrUk_5EOWgsalIbmP5ipPX4y5sJ1H9d4wl0H_u8J4RARabrpOi_74jHJw0E_tzn4');

		$db = JFactory::getDbo();
		// Retrieve the shout
		$query = $db->getQuery(true);
		$query ->select($db->quoteName('*'))
					->from($db->quoteName('#__desktop_notification'));
		// Prepare the query
		$db->setQuery($query);
		// Load the row.
		$result = $db->loadAssocList();
		//print_r($result[1][1]);
		//exit;

		foreach($result as $token)
		{
			$tokens[]=$token['browser_token'];
		}
		

		$header = [
			'Authorization: key=' . SERVER_API_KEY,
			'Content-Type: Application/json'
		];

		$msg = [
			'title' => $article->title,
			'icon' =>'/Brandnet_logo.png',
			'url' => 'https://brandnet.brandix.com'
		];

		$payload = [
			'registration_ids' => $tokens,
			'data' => $msg
		];
		
		$exclude_categories =array(1,2,3);

		if ($article->state == 1 && $article->featured ==1 && !in_array($article->catid,$exclude_categories)){
		

		// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
		$ch = curl_init();

		curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
		curl_setopt($ch, CURLOPT_POST, 1);

		$headers = array();
		$headers[] = 'Authorization: key=AAAArZC_p5Q:APA91bEBoQwWo8DnWDZpL2nV04muLH-Cwawb9h0pNctW7fV6aa6udKPPBU8oRIaAuLpJ6z6kWitGnbRgSd7TOFKJFjWT071yn_rb1ornnnddfFOnP8NjDSStKE_5B6PZDEF8mD3FAvpX';
		$headers[] = 'Content-Type: application/json';
		curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

		$result = curl_exec($ch);
		if (curl_errno($ch)) {
			echo 'Error:' . curl_error($ch);
		}
		curl_close ($ch);


		}


	}

}

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1823
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Save failed with the following error: Unknown column '*' in 'field list'

Post by SharkyKZ » Wed Sep 16, 2020 5:39 am

Change:

Code: Select all

$query ->select($db->quoteName('*'))
to

Code: Select all

$query->select('*')
Also if you made this plugin yourself you might want to edit out your API keys from the post, change your API keys and modify the plugin to not store them in code.

vinushi
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Thu Feb 14, 2019 8:34 am

Re: Save failed with the following error: Unknown column '*' in 'field list'

Post by vinushi » Fri Sep 18, 2020 7:09 am

Hi SharkyKZ,
Thanks for your valuable support.


Post Reply

Return to “General Questions/New to Joomla! 3.x”