juek / CustomSections

Developer plugin for rapid prototyping of custom section types in Typesetter CMS
GNU General Public License v2.0
3 stars 7 forks source link

Install problem #30

Closed mahotilo closed 7 years ago

mahotilo commented 7 years ago

After installation on local server I have a message

setLocale() failed! The locale 'en_US' is probably not available on your server.

juek commented 7 years ago

Just disable the multi_date_event section type by prefixing the foldername with an exclamation mark (!) or via Admin page.

edit: The locale is used for localized date formatting. If you want to build on top of the multi_date_event type, here is where the message is generated.

mahotilo commented 7 years ago

I have renamed folder, have renewed addon, have updated sections. Still have same message

juek commented 7 years ago

Oh, I'm sorry. It's also in the in single_event type

freedomlives commented 7 years ago

This is more a question of typesetter architecture, but why does the section.php code for these types get evaluated even when they aren't used yet on any page on the site? Won't sites then run slower as more unique section types are created?

juek commented 7 years ago

why does the section.php code for these types get evaluated even when they aren't used yet on any page

That's because calling the SectionTypes plugin hook will push every section's type through this filter so plugins can take action when they match. While most section plugins have their 'type' value hardcoded, we autoload them based on [PluginFolder]/_types/* subfolder existence to be able to easily create new section types.

Won't sites then run slower as more unique section types are created?

Yes, any plugin hook call will have (more or less great) impact. Currently we limit needless iterations and parsing by… a) caching the current activated types' metadata in /data/_addondata/CustomSections/types.php to speedup the SectionTypes plugin filter. b) using $section['always_process_values'] = false; in section.php to make Typesetter load saved section content (from respective /data/_pages/[index]/page.php).

Both measures will only apply for regular visitors (not logged-in).

Set $section['always_process_values'] = true; if you want a section type to process data live – like dates or other dynamic values – upon regular visits.