Hot answers tagged

8 votes

unserialize(): Error at offset 0 of 60695 bytes

Adding a "^" to the craftcms version in the composer.json file and then running composer update, did the trick for me. for example: "craftcms/cms": "^3.1.22", I also cleared the cache folder in /...
user avatar
6 votes

Locked out of my Account, how to get back in?

This is not actually my answer since it's from Andrew Welch on Twitter here: https://mobile.twitter.com/nystudio107/status/1063135843441954816 If you have access to MySQL, you can change the admin ...
user avatar
5 votes

Get 404 Error When Going to mydomain.com/news

The .htaccess file was missing the period in the filename when initially installed.
user avatar
5 votes
Accepted

Moving to another database: "Specified key was too long"

I bumped into this last week, and it is exactly as you suspect... your new database does not support InnoDB, which is a requirement of Craft. I'd suggest discussing the matter with your hosting ...
user avatar
  • 23.6k
4 votes
Accepted

Returning errors into templates

I just return the form model object back to the template. Yii has built in validation and error handling within the models themselves. In the example email is the instance of your form's model. The ...
user avatar
4 votes
Accepted

Can I disable logging 404 errors in my craft.log file?

Not currently, but I agree it's kind of annoying. I thought maybe you could pull it off with a plugin since Yii does have an onException event, but there wouldn't be a way to disable logging of 404's ...
user avatar
  • 66.5k
4 votes

Craft internal error exposing sensitive data

Your guess is correct... as the docs say, you should never have devMode enabled in production environments specifically for reasons like this (as well as many others). If you find errors that are ...
user avatar
  • 66.5k
4 votes

An unknown error occurred all the time

I too just had this problem - upon any action in the control panel flashed "An unknown error occurred". What I found in my craft web.log was: "ErrorException: ignore_user_abort() has been disabled ...
user avatar
  • 91
4 votes

Assets Transform returns "Image cannot be found."

A long shot, but if it is indeed a path problem, this has seemed to help me keep my path(s) straight. I my config.php file, I'll set a parameter for environmentVariables like this: ... '.dev' => ...
user avatar
  • 4,696
4 votes
Accepted

Service Unavaliable

You'll get that message if Craft isn't installed and you hit the front-end of the site. You'll want to load the control panel for the installer to trigger as noted in Step 5 of the install docs.
user avatar
  • 66.5k
4 votes
Accepted

No Add New Entry button

There is a Quick Post widget that allows you to create entries from the Dashboard page of the Control Panel. A New Entry button is available from the entries index pages located at the top right, e.g....
user avatar
  • 35.9k
4 votes

An error occurred when rendering a template

You can receive this error if you have uploaded a Craft website and your craft/storage/runtime/cache and craft/storage/runtime/complied_templates folders are not writable. We made these folders ...
user avatar
  • 61
4 votes
Accepted

Best way to find a deprecation error with no location hint?

If you look in the list of file paths in the stack trace there will be one or more files in the storage/runtime/compiled_templates directory. In this particular case there is storage/runtime/...
user avatar
  • 4,361
4 votes

“Request missing required body param” error when creating entry on front end

This was an unintentional breaking change. See https://github.com/craftcms/cms/issues/4693 Update: Fixed in 3.2.9, which is now (2019-08-06) available https://github.com/craftcms/cms/blob/develop/...
user avatar
4 votes
Accepted

Feed me plugin, cURL error 60

I would try adding the following to your feed-me.php config file: <?php return [ '*' => [ 'clientOptions' => [ 'verify' => false, ], ], ]; c.f. https:/...
user avatar
3 votes

Getting image url error code: Impossible to access an attribute ("url") on a null variable

For whatever reason, your site isn't able to find the image. And since your Twig code isn't being defensive, it's failing ungracefully. {% set image = block.media.first() %} This first part is fine.....
user avatar
  • 23.6k
3 votes
Accepted

Error: min/max value in number fields

Numbers have certain limits in computer systems and storing (as well as working with) exceptionally large ones is cumbersome. In the database, the int (integer, a whole number) is limited to a range ...
user avatar
  • 566
3 votes
Accepted

Whitespace created a start of HTML

I finally found what the problem was. The translations files (/craft/translations/de.php) were encoded as "UTF-8 with BOM" I opened these files in Sublime text and saved them as regular old UTF-8, ...
user avatar
  • 301
3 votes
Accepted

Nesting level too deep when looping through matrix blocks

element.type is not a simple string (add {{dump(element.type)}} to your loop to see this). What you should use is element.type.handle. So the assignment is: {% set prevElementType = element.type....
user avatar
3 votes

Sprout Email: Notification unable to create "Craft\WebApp.userGroups

This issue has been resolved in Sprout Email v1.0.4
user avatar
  • 13.3k
3 votes

403 Forbidden Assets

This article will help you set permissions properly for Craft CMS installs: Hardening Craft CMS Permissions It leverages Craft-Scripts to do the heavy lifting.
user avatar
3 votes
Accepted

Why would Craft produce a template loader error (TemplateLoaderException) when rendering its default error pages?

As it turns out, I had made a configuration change that broke Craft's default behavior: 'defaultTemplateExtensions' => array('twig', 'xml') All of Craft's internal templates use .html, and HTML ...
user avatar
  • 3,400
3 votes

My website isn't working: "Craft does not support backtracking to this version. Please upload Craft 2750 or later."

Sounds like your database was updated but your filesystem was not - that could happen perhaps if the development version and the live version share the same database, and only the development version ...
user avatar
  • 3,084
3 votes

An unknown error occurred all the time

Something should be in the logs. If it's happening on every page in the control panel, then most likely it's cURL related. Clear your craft/storage/runtime/logs files, reproduce the issue, then ...
user avatar
  • 66.5k
3 votes
Accepted

Issue trying to use function from DateTimeHelper class: "timeAgoInWords() is not defined"

Generally speaking, only Variable classes are exposed to templates in Craft and there isn't a Variable wrapper for DateTimeHelper. However, that would be a super-simple plugin to write that exposes ...
user avatar
  • 66.5k
3 votes

White Screen of Death

Honestly, that's pretty much impossible to say, it could be pretty much anything – though a white screen is often due to PHP errors, in which case you might find a clue in your log files (located at /...
user avatar
3 votes
Accepted

White screen during installation

Whenever I've had a completely white screen from Craft I've traced it to a syntax error in one of the files in craft/config, so I'd double-check your db.php and general.php if they've been edited.
user avatar
  • 4,361
3 votes
Accepted

Count users, not enough memory error

Use .total() instead of .count() .count() will query the db and fetch all fields for all items relating to your criteria and then count them. .total() only counts the number of items your criteria ...
user avatar
  • 3,833
3 votes
Accepted

Blank white pages after moving index.php

Not sure the underlying cause, but clearing the craft/storage/runtime/cache folder that both sites shared caused both sites to start working as expected.
user avatar
  • 66.5k
3 votes
Accepted

Craft is unable to determine if an update is available at this time

You're getting that error message because there is an existing craft/config/license.key file in place for your local installation and there is no record of that install on the Craft/web service end. ...
user avatar
  • 66.5k

Only top scored, non community-wiki answers of a minimum length are eligible