Search

Hey all, I’m trying to use this extension on a fresh install of 2.1.2 and after creating the section schema DS and attaching it to the necessary page it throws this error on load:

Fatal error: Class 'Administration' not found in /home/eyegatedigital/staged.eyegatemedia.com/symphony/lib/toolkit/fields/field.author.php on line 51

Sooo, I started checking out the extension and found these lines at the top:

// Required for some third party fields
// require_once(CORE . '/class.administration.php');

Thinking, well maybe I should uncomment that require. But then that threw this Symphony error:

Cannot request a page callback without first specifying the page.
An error occurred in /home/eyegatedigital/staged.eyegatemedia.com/symphony/lib/core/class.administration.php around line 96

Any ideas here?

@Nick I noticed that you updated the on Nov 1, which is post 2.1.2 release. So I’m assuming that everything on the extension is in order but any help would be appreciated.

Thanks!

Ah this must have been the reason I added the require_once! I commented it out recently because I couldn’t remember why it was there :-/

The require_once causes other problems, so the unfortunate reality is that the Author field isn’t really compatible with this extension. Try adding author into the incompatible array and it should ignore this field.

Would ignoring the Author field be a problem?

Ah, I see now.

Yes it seems to be incompatible with ‘author’, ‘subsectionmanager’, and ‘entry_versions’ possibly more eh?

For this situation for me it’s fine to ignore those, (I just want a tag roster).

Thanks for the guidance, I hope this helps future releases. It’s a very handy extension by the way, so thanks!

Yes it seems to be incompatible with ‘author’, ‘subsectionmanager’, and ‘entry_versions’ possibly more eh?

Yep probably more. It’s usually the fields that do “non-standard” things when they render in the backend. Because Section Schemas is calling from the frontend the method that renders the field in the backend, sometimes there are simply too many dependencies that the frontend cannot provide.

Thanks for the list, I’ll add these to the official list.

Section Schemas updated to version 1.7 on 5th of February 2011

@nickdunn - Would you mind listing out some of the ways you use this extension? This extension sounds very useful to me, but I don’t know if what context to use it. I don’t know if my brain is not functioning properly (that’s probably it), but would you mind sharing sort of how you use it, in what contexts?

Thanks for your time, and sorry for the dumb question.

BZ

Here’s a quick one: http://www.originaltravel.co.uk/

Click on “Trip Finder” top right and you see a series of select boxes. Most of these are Select Box Links, so the results in Symphony’s backend are populated from the related section, but the Price and Month dropdowns are Select Boxes with static values as these do not change.

To build this on the frontend without Section Schemas we’d have needed to:

  • create a data source for each Select Box Link dropdown to get the possible values
  • hard code the months and prices in the XSLT layer

Instead, we have a Section Schemas data source on the main “Trips” section that returns the same options for the dropdowns that you see in the backend. One data source to get all the data. Best thing is, this plugs right into the Form Controls XSLT script and the select boxes you see (with persistence so they remember their values) become 4 lines of XSLT each. If the European Union decide they want to add a 13th month to the calendar year, we just change it once in the select box config in the backend, and the frontend updates too.

I should add that because this data source runs on every page, and the data changes so infrequently, it is heavily cached (hours at a time).

Another example is when you might make a submission form and you want the fields to be dynamic depending on the fields in the section. With section schemas XML you could step through the XML building your input and select elements in HTML, and also writing out whether they’re required and so on.

But the most common use case for me has been getting the static values of select boxes, tag lists and select box link fields.

Section Schemas + Form Controls = Awesome!

I was playing around with Form Controls a while back and was able to build the code you need to dynamically rebuild Symphony indexes and edit forms in the front end (using the default fields). This code dynamically builds the front end admin pages by populating the form with fields defined by the Section Schemas extension.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="../utilities/section-manager.xsl"/>

<!-- Define a global variable for the section data -->
<xsl:variable name="section-data" select="/data/projects/entry"/>
<!-- Define a global variable for the event action -->
<xsl:variable name="event-action" select="'save-project'"/>

<xsl:template match="data">
    <xsl:call-template name="section-entries"/>
</xsl:template>

</xsl:stylesheet>

The magic happens in the Section Manager utility, which calls the Section Schema utility and Form Controls. Now that Nick has updated his extensions for Symphony 2.2, I was hoping to get this ensemble into shape to demonstrate the possibilities.

If you update the Section configuration, the Section Schemas extension data is updated, and the front end form dynamically updates, along with field validation.

Wow! Thanks Nick and Stephen! What a great help!

Added the following bug to the bug tracker:

Tag list ampersands appear to not be getting sanitized, halting and causing a parse error when it goes to output the array of tag list values. Debug output:

<section-schema id="18" handle="preferred-vendors" total-entries="4" total-fields="5">
    <company-name required="yes" show-column="yes" id="87" label="Company Name" type="input" sortorder="0" location="main" />
    <error>DOMDocument::loadXML(): xmlParseEntityRef: no name in Entity, line: 1</error>
</section-schema>

I tried wrapping just about every "option"-related variable I could find in extension.driver.php with General::sanitize() to no avail, so I'm not entirely sure where it's breaking. Any ideas where I should be focusing, Nick?

Great extension!

You're close. Section Schemas calls the displayPublishPanel method on each field, so the encoding should be found there. For the tag list specifically:

https://github.com/symphonycms/symphony-2/blob/master/symphony/lib/toolkit/fields/field.taglist.php#L104

I've pushed a commit that will sanitize the Taglist field that should solve this problem. This will be in the 2.2.1 Final.

I installed the extension, then went to add a data source. I selected one, but as soon as I clicked save, I got this error: Parse error: syntax error, unexpected '<', expecting ')' in /home/eduapps/webapps/symphony/workspace/data-sources/data.sectionschemablog_entry.php on line 19

Now whenever I go to blueprints > section schemas, or to Blueprints > components, I get a blank page with that same error...

Disabling the extension doesn't help, and there is no sign of the file data.sectionschemeblog_entry.php where it says there should be... Help!

[I'm new here... should this be an issue?]

Section Schemas + Form Controls + Publish Tabs = Even More Awesomeness!

Building off of @bauhouse's awesomeness above, I added the Publish Tabs extension and modified the XSLT to group fields into fieldsets based on Publish Tabs fields. I got additional help from Stackoverflow.

Can I just check that this extension has had it's class name changed to lower case?

Unix filesystems are case sensitive, and every time I install this extension Symphony complains that it can't find the extension.

When I have a textbox with text formatter I get this error:

Symphony Warning: DOMDocument::loadXML(): Entity 'ndash' not defined in Entity, line: 1

An error occurred in /Applications/MAMP/htdocs/housex/extensions/section_schemas/data-sources/datasource.section_schema.php around line 189

184                 // grab the HTML used in the Publish entry form
185                 $html = new XMLElement('html');
186                 $section_field->displayPublishPanel($html);
187
188                 $dom = new DomDocument();
189                 $dom->loadXML($html->generate());
190
191                 $xpath = new DomXPath($dom);
192
193                 $options = new XMLElement('options');
Backtrace
[:0]
    GenericErrorHandler::handler();
[/Applications/MAMP/htdocs/housex/extensions/section_schemas/data-sources/datasource.section_schema.php:189]
    DOMDocument->loadXML();
[/Applications/MAMP/htdocs/housex/symphony/lib/toolkit/class.frontendpage.php:841]
    SectionSchemaDatasource->grab();
[/Applications/MAMP/htdocs/housex/symphony/lib/toolkit/class.frontendpage.php:422]
    FrontendPage->processDatasources();
[/Applications/MAMP/htdocs/housex/symphony/lib/toolkit/class.frontendpage.php:185]
    FrontendPage->__buildPage();
[/Applications/MAMP/htdocs/housex/symphony/lib/core/class.frontend.php:103]
    FrontendPage->generate();
[/Applications/MAMP/htdocs/housex/index.php:22]
    Frontend->display();
Database Query Log
[0.0001] SET character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8';
[0.0001] SET CHARACTER SET 'utf8';
[0.0009] SELECT SQL_CACHE t1.name, t2.page, t2.delegate, t2.callback FROM `sym_extensions` as t1 INNER JOIN `sym_extensions_delegates` as t2 ON t1.id = t2.extension_id WHERE t1.status = 'enabled' ORDER BY t2.delegate, t1.name;
[0.0002] SELECT SQL_CACHE `session_data` FROM `sym_sessions` WHERE `session` = '5214ef11d68e6e139d7bcfbf076ba372' LIMIT 1;
[0.0002] DELETE FROM `sym_sessions` WHERE `session_expires` <= '1363396247';
[0.0002] SELECT SQL_CACHE a.* FROM `sym_authors` AS `a` WHERE `username` = 'Pat' ORDER BY a.id ASC LIMIT 1;
[0.0001] UPDATE sym_authors SET `last_seen` = '2013-03-29 21:10:47' WHERE `id` = 1;
[0.0002] SELECT SQL_CACHE * FROM `sym_pages` WHERE `path` = 'listings' AND `handle` = 'new' LIMIT 1;
[0.0001] SELECT SQL_CACHE type FROM `sym_pages_types` AS pt WHERE pt.page_id = 77 GROUP BY pt.type ORDER BY pt.type ASC;
[0.0002] SELECT SQL_CACHE s.* FROM `sym_gpl_sets` AS s ORDER BY s.name ASC;
[0.0002] SELECT SQL_CACHE `name` FROM `sym_extensions` WHERE `status` = 'enabled';
[0.0003] SELECT SQL_CACHE `s`.* FROM `sym_sections` AS `s` WHERE `s`.`id` IN (9);
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(73);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_uniqueinput` WHERE `field_id` IN (73);
[0.0034] SELECT SQL_CACHE `e`.id, `e`.section_id, e.`author_id`, UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`, UNIX_TIMESTAMP(e.`modification_date`) AS `modification_date` FROM `sym_entries` AS `e` LEFT JOIN `sym_entries_data_73` AS t73_1 ON (e.id = t73_1.entry_id) WHERE 1 AND `e`.`section_id` = '9' AND ( t73_1.value IN ('1544130143') OR t73_1.handle IN ('1544130143') ) ORDER BY `e`.`id`DESC LIMIT 0, 20;
[0.0005] SELECT SQL_CACHE `id` FROM `sym_fields` WHERE 1 AND `parent_section` = 9 AND `element_name` IN ('facebook-id', 'colleges', 'facebook-url', 'profile-pic', 'profile-pic-large', 'role', 'first-name', 'last-name', 'username', 'location', 'gender', 'birthday', 'email') ORDER BY `sortorder` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_73` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_74` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_65` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_66` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_67` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_68` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_69` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_70` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_entries_data_75` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0001] SELECT SQL_CACHE * FROM `sym_entries_data_76` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0001] SELECT SQL_CACHE * FROM `sym_entries_data_77` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0001] SELECT SQL_CACHE * FROM `sym_entries_data_78` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0001] SELECT SQL_CACHE * FROM `sym_entries_data_79` WHERE `entry_id` IN (21) ORDER BY `id` ASC;
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(74,65,66,67,68,69,70,75,76,77,78,79);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_textbox` WHERE `field_id` IN (70,69,68,67,66,65,74);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_enhancedtaglist` WHERE `field_id` IN (75);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_input` WHERE `field_id` IN (76,77,78);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_select` WHERE `field_id` IN (79);
[0.0002] SELECT SQL_CACHE `id` FROM `sym_sections` WHERE `handle` = 'listings' LIMIT 1;
[0.0002] SELECT SQL_CACHE `s`.* FROM `sym_sections` AS `s` WHERE `s`.`id` IN (7);
[0.0002] SELECT SQL_CACHE count(`e`.id) as `count` FROM `sym_entries` AS `e` WHERE `e`.`section_id` = '7';
[0.0003] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`parent_section` = '7' ORDER BY t1.`sortorder` ASC;
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_publish_tabs` WHERE `field_id` IN (25,32);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_reflection` WHERE `field_id` IN (45);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_checkbox` WHERE `field_id` IN (50);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_selectbox_link` WHERE `field_id` IN (85,93);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_textbox` WHERE `field_id` IN (47,48);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_date` WHERE `field_id` IN (26);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_select` WHERE `field_id` IN (23,88,62,63,72,97,33,64,89);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_datetime` WHERE `field_id` IN (29);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_number` WHERE `field_id` IN (44);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_addresslocation` WHERE `field_id` IN (87);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_incrementnumber` WHERE `field_id` IN (46);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_uniqueupload` WHERE `field_id` IN (94);

But which Text Formatter are you using?

It's coming from TextBox field. It uses a long dash -- in the publish HTML markup. Sections Schemas tries to parse this markup and fails, because that dash is unescaped.

Yep that was it. Find + replacing &ndash; with &#8211 in the TextBox extension fixed it.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details