Guest posts seem a little broken.
-
After a guest post is a </ul>, so the rest of that page is broken.
Wasn't like this before.
Link to that post http://35hz.co.uk/topic/12/gifs-webms/27
-
@baris Just tried that as I thought it could be related. Didn't make a difference unfortunately. Will remove it and try updating themes etc.
EDIT: Updated to latest, removed topic.tpl code that I'd added. Still the same. If removing them is easier, I don't mind doing that. They're only posts from ex members of my old forum anyway.
-
@baris Good thinking, created a new post in another topic as a guest, worked fine. Definitely seems to be something with the old guest posts, if I delete that post, there's another further down the page that it will break at. I deleted two posts further up until I realised.
-
that costume :ana:
:ana: was an old smilie that we don't use on the new forum. I've tried editing the post etc, nothing changes.
Could this be an issue I didn't spot from when I changed the guest ID to 0 a few months back in another of my topics?
But then I don't see why it's adding </ul></div> to the end of a guest post because of that. scratches head
I don't mind deleting them if that will be easier. (However I do that)
-
Ok, I've worked it out, it's because the UID is "undefined", thought I'd fixed all of these in this topic but apparently not.
Is there a quick way of changing all uids from undefined to 0? Or do I need to find the pid, then hset post uid :0 for each one?
-
If you want you can run a one time script to fix the uids, backup your database before running it and then add the following code here
router.get('/fixguestposts', function (req, res) { var async = require('async'), db = require('../database'); function fixOwner(pid, next) { posts.getPostField(pid, 'uid', function(err, uid) { if (err) { return next(err); } if (parseInt(uid, 10) >= 0) { return next(); } posts.setPostField(pid, 'uid', 0, next); }); } db.getSortedSetRange('posts:pid', 0, -1, function(err, pids) { if (err) { res.json(500, err.message); } async.eachLimit(pids, 10, fixOwner, function(err) { if (err) { res.json(500, err.message); } res.json(200, 'done'); }); }); });
Run the forum in dev mode and browse to
http://35hz.co.uk/debug/fixguestposts
It will go through every post and check theiruid
if its greater or equal to 0 it won't do anything, if not (ie undefined null) it will set it to 0.