Permalink
Browse files

Fixed column display bug, and fixed bug finding the primary field in …

…a section.
  • Loading branch information...
1 parent b82f50a commit f4e1c3809da58c6f58c3d96eb65089b87be9057e @psychoticmeow psychoticmeow committed Jun 9, 2011
Showing with 14 additions and 6 deletions.
  1. +13 −1 extension.driver.php
  2. +1 −5 fields/field.breadcrumb.php
View
@@ -355,8 +355,20 @@ public function getFieldBySectionId($section_id) {
$sm = new SectionManager(Symphony::Engine());
$section = $sm->fetch($section_id);
$fields = $section->fetchVisibleColumns();
+ $title = null;
- if (empty($fields)) return null;
+ if (empty($fields)) {
+ throw new Exception('Could not find the primary field.');
+ }
+
+ foreach ($fields as $field) {
+ if ($field instanceof FieldBreadcrumb) continue;
+
+ return $field;
+ }
+
+ // No visible fields!
+ $fields = $section->fetchFields();
foreach ($fields as $field) {
if ($field instanceof FieldBreadcrumb) continue;
@@ -515,11 +515,7 @@ public function prepareTableValue($data, XMLElement $link = null, $entry_id = nu
$span = new XMLElement('span');
$span->setAttribute('data-breadcrumb-entry', $entry_id);
$span->setAttribute('data-breadcrumb-depth', 0);
-
- // If this is not going in the first column, sort it in reverse:
- if (!$link instanceof XMLElement) {
- $links = array_reverse($links);
- }
+ $links = array_reverse($links);
if (isset($root_id) && $root_id != $entry_id) {
$span->setValue(current($links));

0 comments on commit f4e1c38

Please sign in to comment.