bolt / bolt

Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.
MIT License
4.15k stars 809 forks source link

Template "entry.twig" is not defined (). #46

Closed gmoigneu closed 11 years ago

gmoigneu commented 11 years ago

Hi ! and thanks for making Bolt a wonderfull CMS !

I got a weird problem while loading an entry. I've got two entries in database (contenttype: entry). One is loading fine. The other (which was written before) display this error :

Class: Twig_Error_Loader Message: Template "entry.twig" is not defined (). Code: 0

Cache cleared (through interface and manually)

Got any idea ? Thanks

pvankouteren commented 11 years ago

Hi! Some questions regarding the issue:

gmoigneu commented 11 years ago

Running on cf847aa12976bfea2197e73e6b2891872133da7b (Sun Nov 18 16:46:59 2012 +010)

I can't see any differences between the entries. Here is the SQL dump : http://pastebin.com/Lw05MmJ2

And my contenttypes :

entries: name: Entries singular_name: Entry fields: title: type: text class: large slug: type: slug uses: title image: type: image teaser: type: html height: 150px video: type: video body: type: markdown height: 300px kudos: type: number taxonomy: [ categories, tags ] record_template: entry.twig listing_template: listing.twig listing_records: 10 sort: datecreated DESC recordsperpage: 7 rss: enabled: true feed_records: 10 feed_template: rss.twig content_length: 250

gmoigneu commented 11 years ago

Just updated to f42ccdde4c48e6c487c4b620b3ff86fffe6854c5 and I got the same error.

pvankouteren commented 11 years ago

I'll try and reproduce your issue

Oh AND I (or somebody else) will try to solve it as well ;-)

bobdenotter commented 11 years ago

I actually bumped into the same issue today, so i'll most likely be able to reproduce and fix it.

pvankouteren commented 11 years ago

Ah, that'd be great. Be sure to also take a look at issue #20 :)

bobdenotter commented 11 years ago

Note: this doesn't solve the issue yet. Just helps me pinpointing it. Expect a fix soon. :-)

bobdenotter commented 11 years ago

So, the issue might be fixe now, and it might not be. Regardless, if you could try updating, then it will either have fixed the problem, or it gives you a better error, or at the very least it will give us a hint where to continue looking.

See the screenshot: screenshot

gmoigneu commented 11 years ago

After update, problem is still happening :



Used templates:
1. view/error.twig
2. view/_header.twig
3. view/_footer.twig

Route: /_contenttypeslug_slug
Request URI: /entry/migrating-from-wordpress-to-bolt
Parameters: 
arr(2) 
[
    "contenttypeslug" => str(5) "entry"
    "slug"            => str(32) "migrating-from-wordpress-to-bolt"
]```
bobdenotter commented 11 years ago

So, for some reason there's no message about the missing template, but bolt still falls back to the error template. The (contenttype) in the notification means that you've set entry.twig in your contenttype.yml, which should be OK.

Are you positive that the file /theme/svbtle/entry.twig exists, and is readable by the webuser? Does the 'log entries' box in the debug bar mention anything?

gmoigneu commented 11 years ago

Yes, the entry.twig is present and readable. And it's correctly working for another entry. The log doesn't contain anything.

/var/www/nls.io/web(branch:master*) # ls -la theme/svbtle/entry.twig
-rwxrwxr-x 1 web13 client7 943 21 nov.  21:19 theme/svbtle/entry.twig

Do you want a direct SSH access to the files if it can help ?

bobdenotter commented 11 years ago

Yes, if i could have access to the ssh (and Bolt itself, of course), i'm pretty sure i can figure out what the bug is. Feel free to mail me at bobdenotter@gmail.com.

djoeybodenstaff commented 11 years ago

After publishing an entry, I get the same error as mentioned above. I'm working with Bolt 0.95. Log entries: ". PHP-Notice: Undefined offset: 1. in: /public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php::166

  1. PHP-Notice: Undefined index: record_template. in: /public_html/app/src/Bolt/Content.php::550
  2. Template "" is not defined (). in: /public_html/app/app_backend.php::217
  3. PHP-Notice: Undefined index: file. in: /public_html/app/app_backend.php::230 "
bobdenotter commented 11 years ago

You should check your config.yml. There should be a line record_template: blabla... in it. If not, copy it over from config.yml.dist.

djoeybodenstaff commented 11 years ago

Is there a way for auto select the template you want? So 'page.twig' for pages and so on.