Forum

Thread tagged as: Problem, Error, Blog

Invalid query after blog module update

Hi!

I updated the blog module, I think from 3.8.x something to now newest 4.5.4, and am now given error:

Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'authorGivenName' in 'field list'

In the database all the authorGivenName fields are populated... oh what to do?

Karri Karttunen

Karri Karttunen 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does it look like in your post.html? You might just need to add type="hidden" to the tag.

Yep, that was it.

I had this without the type="hidden"

<perch:if exists="authorGivenName"><perch:blog id="authorGivenName" type="hidden" /> <perch:blog id="authorFamilyName" type="hidden"/></perch:if>

Works fine, thanks again Drew!

Hello, again. I think this is related to above. Everything seems to work fine but I found this in apache error.log:

PHP Fatal error: Class 'PerchCategories_Categories' not found in /perch/addons/apps/perch_blog/runtime.php on line 502

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have the Categories app installed and added to your apps.php file?

Ok, got it working.

That was the error. First I tried to add only content and category to apps.php, but that hid all the data. After all the modules (Blog, Form, Mailchimp) was there almost everything worked.

The blog didn't update the categories correctly after template (perch:blog -> perch:categories) modification. The <?php perch_blog_categories(); ?> didn't show the categories. I tried to republish everything, but this only republished the pages, not the blog. I got them working after saving each blog post again. Or was there some correct way to do this?

Now only one odd thing remains, with cron. After the update Perch cron spams Cron Daemon when run with crontab. This didn't occur before!

When I run it from the browser everything is fine, but when it's set in crontab it sarts mailing. It sends empty mails. I know I can log the the event also or disable the notifications entirely. What do you think, Drew?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you explain what you mean by "Perch cron spams Cron Daemon when run with crontab" ?

Yep.

So when cron runs Perch task:

php /mylocation/perch/core/scheduled/run.php mypassword

I start getting emails to root@myserver.com from Cron Daemon root@myserver.com

They occur every minute, the maximum I allowed them to mail me 12 - after that I edited the crontab and commented the Perch cron off.

The subject for these messages is: Cron <root@myserver> php /mylocation/perch/core/scheduled/run.php mypassword

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. That sounds like a cron configuration issue.

Well, this didn't happen before the update also all other perch sites are working just fine.

I only have in crontab for this site to run cron at 6am:

  • */6 * * * php /mypath/perch/core/scheduled/run.php mypassword

... I could try to change tha password, but after edit cron does not cache. So I don't think that will help.

I changed the crontab to run only once per day at 21 and the password for it. That didn't help.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What's in the email?

They are empty.

Drew McLellan

Drew McLellan 2638 points
Perch Support

OK. It may be something is outputting white space.

I tried to update the Mailchimp app, even if I had the newest already. Surprisingly no effect :)

I still think that it's strange that I don't get any mail notifications when I run it from the shell or http.

Any ideas on how to debug the white space?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've no idea. It's not happening to me here, and I have cron running every 10 minutes, 24 hours a day.

I only get an email when there's an error.