Problems updating blog app
I've just upgraded to the current version of Perch no problem as far as I can tell. I then attempted to update the blog app from, I think, version 3.0.1. The following is from perch/addons/apps/perch_blog:admin.php
$this->register_app('perch_blog', 'Blog', 1, 'A simple blog', '3.0.1');
$this->require_version('perch_blog', '2.0.2');
I copied the latest version of perch_blog flder into /perch/addons/apps and also the new template files into perch/templates/blog.
However all the content added via the text editor (CKeditor) disappeared. I updated to the latest version of CKeditor.
I have now reverted to the old version of the blog and CKeditor and the content is displaying as it should.
Any ideas as to whare I may have gone wrong?
I'm planning on installing the events app. Do I need the latest version of the blog app?
Thanks Alan
Did you update your templates as explained in the documentation?
https://docs.grabaperch.com/addons/blog/installation/
I decided to go with the suggestion in the documentration... "The easiest way to do this might be to take the new default templates and re-customise it to fit your site."
So, I copied the new templates over my existing perch/ templates/blog files as it seemed a more straightforward approach. I then changed the editor from the default to CKeditor, but that was the only change I made to the new templates.
All the blog posts remained available in the back end but the content was missing from the text editor fields.
Did I miss something? Thanks.
Did your old templates have the exact same field names as in the new ones, if not then I would expect your content to disappear.
Please show us your post.html template.
Ok, here you go. Thanks.
Did your old templates have the exact same field names as in the new ones?
Hmmm... the problem is it's a while since I set the templates up and I can't honestly remember what changes I made to the default template files. Please excuse the question but can you clarify what you mean by field names?
The example (above) of my current post.html is obviously different from the new default post.html file. I gather this is the file i need to amend... I've read the installation documentation but confess I find it a bit confusing.
I just checked my apps.php it has the old code:
Should I change it to:
It's worthing changing your
apps.php
yes.Are the IDs in the template the same?
Mostly. The old file has id="postSlug" instead of id="postURL" apart from that the IDs that I have in my file are the same.
Ok great.
If you add debug to your page, that's not displaying posts, what does it output?
I've updated the blog app and the blog template files and added debug.
I'm getting the following on the backend:
The following on the blank post:
This bit is worrying:
Why is there no template specified?
Not sure. As I mentioned I set the blog up a few years back when I knew even less than I do now...if that's possible!
Can you tell me where and how I should specify a template? Thanks.
What does the code on your page look like where you're trying to display the posts?
The archive links, tags etc all display. But the post itself doesn't.
This is the code from post.php which is in root folder/blog I tweaked them when I set things up way back. I'm not sure where to find the post.php page in the new perch_blog install.
This is what I get when I view source.
Do you have a
post.html
template?Yes I have the templates from updated version of the blog app perch_blog_v4.5.4/addons/apps/perch_blog/templates copied into perch/templates/blog
I kept my old post.html (along with the others) in a folder renamed blog-old so I can easily restore and edit them if needed.
Ok. I'm not sure what's going on. Is there anything else you can tell me?
Not really. I'm wondering if I need to replace the files inside /root/blog eg post.php with the equivalent files rom the new install? I notice index.php now uses several includes unlike the old version.
I'll give that a go and see what happens.
Alternatively I could revert to the old version of the blog. Would running this be a problem? Or maybe copy and paste the post contents into the new blog.
I'm working on a local version recently downloaded so can copyand paste from the live site. Luckily my client doesn't post that often!
Sorry, I don't know what else I can tell you.
You could try the example files and see if they work - in a different folder if needs be.
Update: I added the new files to the root/blog folder and got a completely blank page.
Reverting to the original index.php the posts page displays evrything except the post itself.
I confess I'm confused over the specific roles of post.html and post.php. The following is in post.php
displays so it seems
Is related to the problem. Unfortunately I don't have a clue.
The code for the current post.html page is
In the backend on the edit post page the following debug message:
This is in red:
It's difficult to know what to look for without understanding PHP!