I am getting this error on the web page:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: blog_links
Filename: libraries/Fuel_blog.php
Line Number: 983
and then:
A Database Error Occurred
Error Number: 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 'published` = 'yes' ORDER BY `precedence` desc' at line 3
SELECT `fuel_blog_links`.* FROM (`fuel_blog_links`) WHERE `.`published` = 'yes' ORDER BY `precedence` desc
in the blog.php, there is this:
$config['tables']['blog_links'] = 'fuel_blog_links';
and in Fuel_blog.php:
function get_links($where = array(), $order_by = 'precedence desc', $limit = NULL, $offset = NULL, $return_method = NULL, $assoc_key = NULL)
{
$this->CI->load->module_model(BLOG_FOLDER, 'blog_links_model');
$this->CI->blog_links_model->readonly = TRUE;
$tables = $this->CI->config->item('tables');
$where[$tables['blog_links'].'.published'] = 'yes';
$links = $this->CI->blog_links_model->find_all($where, $order_by, $limit, $offset, $return_method, $assoc_key);
return $links;
}
I don't really see anything wrong that could be causing this error. Why would $tables['blog_links'] be an empty string?
Comments
https://github.com/daylightstudio/FUEL-CMS-Blog-Module
git.exe pull -v --progress "origin"
From https://github.com/daylightstudio/FUEL-CMS-Blog-Module
= [up to date] master -> origin/master
= [up to date] develop -> origin/develop
Already up-to-date.
So I downloaded the zip, unzipped it, then did a comparison with what I have and there are no changes.
If you download the zip, be sure to do it from the develop branch URL:
https://github.com/daylightstudio/FUEL-CMS-Blog-Module/tree/develop
A Database Error Occurred
Error Number: 1066
Not unique table/alias: 'fuel_blog_users'
SELECT COUNT(*) AS `numrows` FROM (`fuel_blog_posts`) LEFT JOIN `fuel_blog_users` ON `fuel_blog_users`.`id` = `fuel_blog_posts`.`author_id` LEFT JOIN `fuel_blog_users` ON `fuel_blog_users`.`fuel_user_id` = `fuel_users`.`id`
The problem is the last LEFT JOIN table should be fuel_users, not fuel_blog_users.
A Database Error Occurred
Error Number: 1054
Unknown column 'fuel_tags.context' in 'where clause'
SELECT fuel_tags.id, fuel_tags.name FROM (`fuel_tags`) LEFT JOIN `fuel_categories` ON `fuel_categories`.`id` = `fuel_tags`.`category_id` WHERE (FIND_IN_SET("blog", fuel_tags.context) OR fuel_tags.context="") ORDER BY `fuel_tags`.`name` asc
There is no fuel_tags.context. Was this meant to be fuel_categories.context?
blog_posts_model.php:
function __construct()
{
parent::__construct('blog_posts', BLOG_FOLDER); // table name
$CI =& get_instance();
if ($CI->fuel->blog->config('multiple_authors'))
{
$authors = array('authors' => array('model' => array(BLOG_FOLDER => 'blog_users')));
$this->has_many = array_merge($authors, $this->has_many);
}
$this->has_many['tags']['where'] = '(FIND_IN_SET("blog", '.$this->_tables['fuel_categories'].'.context) OR '.$this->_tables['fuel_categories'].'.context="")';
Question though: When you create an Author, then go back to edit that user, you can change it to a different Fuel user (it changes the fuel_user_id). But, the Display Name stays the same as the first User. Is there a way of resolving this so that the display_name changes each time the fuel_user_id is changed?
Specifically:
`description` text COLLATE utf8_unicode_ci NOT NULL,
`context` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`language` varchar(30) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'english',
I had to add these in manually.
`description` text NOT NULL,
`language` varchar(30) NOT NULL DEFAULT 'english',
ALTER TABLE `fuel_categories`
CHANGE COLUMN `name` `name` VARCHAR(255) NOT NULL DEFAULT '' COLLATE 'utf8_unicode_ci' AFTER `id`,
CHANGE COLUMN `slug` `slug` VARCHAR(255) NOT NULL DEFAULT '' COLLATE 'utf8_unicode_ci' AFTER `name`,
CHANGE COLUMN `description` `description` TEXT NOT NULL COLLATE 'utf8_unicode_ci' AFTER `slug`,
CHANGE COLUMN `context` `context` VARCHAR(100) NOT NULL DEFAULT '' AFTER `description`,
CHANGE COLUMN `language` `language` VARCHAR(30) NOT NULL DEFAULT 'english' COLLATE 'utf8_unicode_ci' AFTER `context`;
For the fuel_categories, the blog_posts module is setup to pull in categories that have the context value of blank or "blog". It has the following where condition tied to it:
(context = "blog" OR context = "") AND language = "{language}" OR language = ""