Topic: unable to edit posts

I am using punBB with SQLIte, and the server may be a tad slow but currently I am unable save any edits to posts. The same edit file works fine with my local development copy of punBB but that utilises mySQL.

I get to edit.php, I can edit the post and preview it, but I am unable to update the database. The page just goes 'blank', as if it has timed out.(which I know is a possibility)



As I know debug mode is likely to be suggested... can it be enabled just for the one script? or just for admin/moderator scripts? (or even just when an admin is logged in?)

my mind is on a permanent tangent
byUsers forum

Re: unable to edit posts

http://punbb.org/forums/viewtopic.php?pid=85805#p85805

It looks like it's an SQLite issue, although I haven't found other references to it

Re: unable to edit posts

hmmm, I am going to test a few things to see if I can narrow the problem down. There should be no reason why SQLite is causing a problem! *sigh*

my mind is on a permanent tangent
byUsers forum

Re: unable to edit posts

Ok narrowed it down to the following section:

if ($can_edit_subject)
        {
            // Update the topic and any redirect topics
            $db->query('UPDATE '.$db->prefix.'topics SET subject=\''.$db->escape($subject).'\' WHERE id='.$cur_post['tid'].' OR moved_to='.$cur_post['tid']) or error('Unable to update topic', __FILE__, __LINE__, $db->error());

            // We changed the subject, so we need to take that into account when we update the search words
            update_search_index('edit', $id, $message, $subject);
        }
        else
            update_search_index('edit', $id, $message);

Could it simply be a time out issue?

my mind is on a permanent tangent
byUsers forum

Re: unable to edit posts

so after adding in set_time_limit(99999999); before the code above, I managed to grab the debug info from the redirect page and this gives me:

Debug information
Time (s)     Query
0.00195     SELECT u.*, g.*, o.logged, o.idle FROM users AS u INNER JOIN groups AS g ON u.group_id=g.g_id LEFT JOIN online AS o ON o.user_id=u.id WHERE u.id=1987
0.00081     UPDATE online SET logged=1170843308 WHERE user_id=1987
0.00036     SELECT * FROM online WHERE logged<1170843009
0.00115     SELECT f.id AS fid, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.id AS tid, t.subject, t.posted, t.closed, p.poster, p.poster_id, p.message, p.hide_smilies FROM posts AS p INNER JOIN topics AS t ON t.id=p.topic_id INNER JOIN forums AS f ON f.id=t.forum_id LEFT JOIN forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=1) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.id=27509
0.26939     SELECT id FROM posts WHERE topic_id=3600 ORDER BY posted LIMIT 1
0.01078     UPDATE topics SET subject='test thread for editing etc.' WHERE id=3600 OR moved_to=3600
0.06353     SELECT w.id, w.word, m.subject_match FROM search_words AS w INNER JOIN search_matches AS m ON w.id=m.word_id WHERE m.post_id=27509
0.03694     DELETE FROM search_matches WHERE word_id IN(34,1130,1349,2421,3805,9319) AND post_id=27509 AND subject_match=0
0.00096     UPDATE posts SET message='increased time out. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse est massa, venenatis et, scelerisque quis, suscipit eget, leo. Cras convallis scelerisque sapien. Sed hendrerit lobortis pede. In molestie. Curabitur ullamcorper lectus ac pede. Sed quis sem et tortor ultrices aliquet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam in sapien vitae mauris adipiscing pellentesque. Sed in libero vitae est faucibus dignissim. Pellentesque lacus tortor, volutpat at, iaculis nec, ornare a, diam. Fusce sit amet enim. Vestibulum vitae tortor eu orci ultricies sollicitudin. Phasellus luctus, ante a dignissim sollicitudin, quam ligula mollis ante, id ullamcorper nibh felis quis risus. Integer congue leo in neque. Phasellus dictum. Fusce malesuada, nisl in iaculis placerat, nulla elit ultrices ligula, vel pretium quam dolor eget ipsum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Donec nisl turpis, fermentum ut, fringilla in, rutrum id, quam. Morbi pulvinar, enim eu elementum eleifend, augue odio tincidunt nisi, sed dignissim purus ipsum nec neque. Nunc rutrum, dolor quis commodo fermentum, lectus sem volutpat dolor, ac consequat sapien neque quis orci. Aliquam tempor, dui in consequat ornare, pede odio posuere libero, malesuada blandit libero dolor vitae dolor. Duis dapibus leo nec nulla. In venenatis turpis sed nunc. Morbi aliquet. Sed neque leo, vehicula aliquet, scelerisque nec, venenatis nec, est. Donec pharetra commodo felis. Nullam tincidunt, sapien at feugiat malesuada, elit nisi posuere nisi, non volutpat enim neque id ligula. Quisque luctus velit vitae orci feugiat eleifend. Vivamus fermentum erat suscipit nisl. Nullam et est eu libero dictum semper. Aenean ac sapien nec justo euismod scelerisque. Fusce volutpat. Pellentesque sit amet urna. Vestibulum luctus. Duis mi turpis, consequat quis, laoreet quis, mattis vel, enim. Cras imperdiet condimentum sapien. Sed iaculis. Maecenas gravida. Maecenas arcu pede, malesuada et, aliquam dapibus, consequat a, augue. Aenean ligula tellus, dapibus non, condimentum eu, convallis nec, ipsum. Nullam bibendum augue vel nunc. Nullam sed velit eget felis rutrum consectetuer. Maecenas erat orci, hendrerit eget, viverra ac, scelerisque non, quam. Sed consectetuer sagittis odio. Phasellus hendrerit. Duis quis ipsum. Maecenas sed massa sed mi interdum suscipit. Nunc lorem magna, venenatis eu, tempor a, volutpat quis, dui. Pellentesque scelerisque scelerisque massa. Aenean mi justo, venenatis in, convallis ac, lacinia vel, quam. Suspendisse elementum erat scelerisque ligula. Mauris tincidunt cursus enim. Maecenas cursus fringilla metus. Donec sagittis ultricies felis. In vestibulum bibendum massa. Etiam tincidunt. Vestibulum dolor elit, blandit vitae, mollis nec, ultricies vel, augue. Aliquam in dolor. Sed nec nunc. Curabitur ut mi. Aliquam interdum sem et tortor.', hide_smilies='0' WHERE id=27509
Total query time: 0.38587 s

Which seems fast enough, but it takes almost 10 seconds to get to that page!

my mind is on a permanent tangent
byUsers forum