Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to use date_format to get a readable date out of $node->created but instead I got an error message and now I cannot even edit or reset the template for that node type. What can I do?
Fatal error: Call to undefined method stdClass::created() in /home/cpelham/public_html/drupal/modules/contemplate/contemplate.module(588) : eval()'d code on line 3
Surely I don't have to delete that node type?! Is there at least a way to edit the database?
Finally, how ARE we supposed to produce a readable date from $node->created ?
Comments
Comment #1
cpelham CreditAttribution: cpelham commentedI tried updating to 5.x-1.x-dev to see if that would open up a way out but when I ran update.php, it failed with the error:
Failed: CREATE TABLE contemplate_files ( site varchar(256) NOT NULL, data longblob NOT NULL, UNIQUE KEY site (site) ) /*!40100 DEFAULT CHARACTER SET utf8 */;
Help!
Comment #2
cpelham CreditAttribution: cpelham commentedI managed to edit my problematic node type's contemplate entry in the mysql database directly easily enough and rid myself of the first error, but I may now be halfway between 5.x-1.3 and 5.x-1.x-dev as I still have the error
Error
SQL query:
CREATE TABLE contemplate_files(
site VARCHAR( 256 ) NOT NULL ,
DATA LONGBLOB NOT NULL ,
UNIQUE KEY site( site )
) DEFAULT CHARACTER SET utf8
MySQL said: #1170 - BLOB/TEXT column 'site' used in key specification without a key length
I believe that the solution is to change VARCHAR ( 256 ) to VARCHAR ( 255 ) as 255 is I think the maximum value that VARCHAR can be assigned. Probably this was just a typo? I'm sorry I don't know how to offer this as a patch.
Comment #3
RobLoachThis is related to this issue.... Try applying that patch to see if it works.