i get this errors if i open "admin/build/themes/settings/mytheme" if i only have mytheme_settings() function implemented.

notice: Undefined property: stdClass::$prefix in C:\Inetpub\wwwroot\drupal6\modules\system\system.admin.inc on line 480.

Additional there is another documentation bug at http://drupal.org/node/132442 (Custom theme settings). There is written i can use phptemplate_settings() function, but this doesn't work as it does in Theme Settings API 5.x and produce an additional error. Code looks like this should be named phptemplate_engine_settings(), but this isn't working and gives errors, too.

notice: Undefined property: stdClass::$prefix in C:\Inetpub\wwwroot\drupal6\modules\system\system.admin.inc on line 491.

Comments

JohnAlbin’s picture

The documentation is correct. A theme should use phptemplate_settings(). Only Theme Engines (like the PHPTal theme engine or Smarty theme engine) should use ENGINE_engine_settings().

If the code doesn’t work as the docs say they should then its a bug in the code, not the docs.

I’m on the verge of being out of town for 4 days, but I’ll look at this as soon as I can.

hass’s picture

Up's... i found something :-(. It looks like i missed to set engine = phptemplate in mytheme.info file... now the errors seems gone.

We should re-think if you shouldn't add a helpful error message in such cases.

JohnAlbin’s picture

Yes, a decent error message would help tremendously. Also, we should make sure that old school, "plain php" templates still work with the updated API.

JohnAlbin’s picture

Title: theme-settings: Undefined property: stdClass::$prefix » missing "engine=" in theme.info file causes: "Undefined property: stdClass::$prefix"
Component: system.module » theme system

Plain php themes work fine. I added some test settings to chameleon and didn’t receive any errors.

Do we really need to set an error message if the theme author screws up their .info file?

hass’s picture

Not sure, but the error is very strange and you don't get an idea that missing engine is the cause of this error message.

I'm sure more themer's or theme upgrader's will have this problem, too. Maybe enough if we are more clear in "Themes now have .info files" section in the update handbook that this line is a MUST for phptemplate and not only a "should set it as phptemplate", what i have simply "skipped" and thought phptemplate is default engine since 4.7.x and therefor the value should defaults to phptemplate engine :-).

chx’s picture

Title: missing "engine=" in theme.info file causes: "Undefined property: stdClass::$prefix" » Document that for Drupal 6 engine= is mandatory in theme .info
Project: Drupal core » Documentation
Version: 6.x-dev »
Component: theme system » Customization and Theming Guide
Status: Active » Closed (won't fix)
chx’s picture

Status: Closed (won't fix) » Active
add1sun’s picture

Status: Active » Fixed

I added the "required" info to the updating themes page and put some basics on the .info handbook page (http://drupal.org/node/137062) so that it is clear engine is required.

I don't know that an error message is required for this. I'm marking this fixed but if someone wants to pursue error message they should reopen and move the issue to Drupal, not Docs.

Anonymous’s picture

Status: Fixed » Closed (fixed)