Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-08-04 17:21:01

ande
Member
Registered: 2007-01-21
Posts: 25

4.4.1 file backend showing "Notice: Undefined variable: title"...

Sorry I did not find the bugs forum so I hope I found the right place..

With 4.4.1 I noticed this (not checked if this happens with previous versions):

Wehn I open the “files” backend in the TXP administration, I get a long list of (one for every file listed):

“Notice: Undefined variable: title in …something/web/textpattern/include/txp_file.php on line 271”

I have checked the sourcecode, line 271 is:

td(htmlspecialchars($title), 90, ‘title’).

And it is true, the MySQL table txp_file has no “title” field! How come?

Maybe because I’ve limited the rights of the MySQL user to “read, write, delete, update” for security reasons and TXP was trying to modify the database when updating? Maybe it would be a good test in the furture to check if the MySQL permissions are set right before upgrading?

How should the tables look like? At the moment:

CREATE TABLE IF NOT EXISTS `txp_file` ( `id` int(11) NOT NULL auto_increment, `filename` varchar(255) NOT NULL default ‘’, `category` varchar(255) NOT NULL default ‘’, `permissions` varchar(32) NOT NULL default ‘0’, `description` text NOT NULL, `downloads` int(4) unsigned NOT NULL default ‘0’, `status` smallint(6) NOT NULL default ‘4’, `modified` datetime NOT NULL default ’0000-00-00 00:00:00’, `created` datetime NOT NULL default ’0000-00-00 00:00:00’, `size` bigint(20) default NULL, `author` varchar(255) NOT NULL default ‘’, PRIMARY KEY (`id`), UNIQUE KEY `filename` (`filename`), KEY `author_idx` (`author`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 AUTO_INCREMENT=xxx ;

Offline

#2 2011-08-04 17:28:10

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: 4.4.1 file backend showing "Notice: Undefined variable: title"...

Give the MySQL user the appropriate rights, then modify the txp_prefs table: find the record where name=‘version’ and set val=‘4.x.x’ where 4.x.x is the version you had installed before. Now log in on the admin side of TXP and it’ll do the necessary updates.

Offline

#3 2011-08-04 17:49:49

ande
Member
Registered: 2007-01-21
Posts: 25

Re: 4.4.1 file backend showing "Notice: Undefined variable: title"...

That was it, thanks!

However: Might be nice to be reminded by Textpattern that update failed because those permissions were missing.. now this a friendly feature request :-)

Offline

Board footer

Powered by FluxBB