Code Monkey home page Code Monkey logo

order_entries's Introduction

Order Entries

Installation

  1. Upload the 'order_entries' folder in this archive to your Symphony 'extensions' folder.
  2. Enable it by selecting the "Order Entries", choose Enable from the with-selected menu, then click Apply.
  3. You can now add the "Entry Order" field to your sections.

Usage

  1. Add the "Entry Order" field to your section and tick the "Show column" box.
  2. Click the column heading to sort table by the Entry Order field to enable drag and drop.
  3. When ordered ascending, drag entries within the table and the orders will be re-saved.

Pagination

As of version 2.1.4 Order entries has an additional pagination order per entry. Through this one can set a particular section to be paginated or not.

When using normal pagination the extension makes sure that entries within the page start with the offset of that particular page. For Example if you're on page 3 with 20 entries per page, the first entry will take a minimum index of 41. As this is the least possible to be after the last one of the previous page.

Filtered Views

Since Filtering made it to the core, some problems have arisen in regards to Order Entries. In it's previous form filtering and re-ordering would reset the index of that particular sort to start from 1. This is not always the expected result, with the changes implemented in this version, the offset will start from the minimum index found in the entry. So if you're sorting entries which were numbered 4, 5 and 6 they will keep the same index values when resorted. However if you are sorting 4, 6 and 12 sorting would give the following indices; 4, 5 and 6.

Note that if you plan to use the sorting values only within the filtered views, and use that within your data sources this change will not impact your workflow.

Filtered Ordering

Order Entries now supports an option to filter entries and order them separately. To activate this functionality you have to select which fields you would like to use for filtering from within the settings panel. Once saved, filtered views will have separate orders depending on your settings.

It is very important to note that with version 2.2 the "Filter value" used within the publish page matches whatever you put in your datasource. Sorting and order values are determined from the matching datasource parameter. If in the publish page was filtered by "Home" and your datasource filter says "home" the datasource ordering outputs will not match.

Note: If you set filtered ordering, and within the backend no filters unset all sorting is done without any backend filters, and your datasource contains a filter for the same field as 'filtered ordering' no ordering will take place. As there are no values set with the backend filters matching the ones in your datasource.

Example Use Case

You have been asked to design a schema for a cooking website. Where each recipie has a number ingredients, thus you link your ingredients to your recipes using an association field. The client has also asked to be able to do a dedicated page per ingredient showing the suggested recipies, and they want to order all the supported recipes manually.

Within your recipes section, you add a 'filtered ordering' on the 'ingredients' field This will create a distinct sort order for each ingredient when filtered within your backend.

Thus the recipe 'Spagetti Bolognese' can be in 1st place for 'spagetti', 2nd place for 'tomato sauce' and 4th place for 'minced meat'. Whilst 'lasagna' could be in 3rd place for 'tomato sauce' and 3rd place for 'minced meat'. At the same time in the general recipie classification (no filters) 'Spagetti Bolognese' ranks 5th and 'Lasagna' 15th.

order_entries's People

Contributors

animaux avatar beaubbe avatar brendo avatar chobohub avatar davidoliver avatar idea07 avatar jensscherbl avatar jharriesairlock avatar jonmifsud avatar klaftertief avatar lnikkila avatar michael-e avatar nathanhornby avatar nickdunn avatar nilshoerrmann avatar nitriques avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

order_entries's Issues

Incompatible with "Ajax Checkbox" due to vague jquery selector

Order Entries (Latest Master with S2.5beta) seems to recalculate numbers based on the amount of "input"-elements found in the entries table. This results in wrong numbers when other input-elements (e.g. via "Ajax Checkbox") are added to the table.

Changing line 78 from...

var items = table.find('input'),

to a more specific selector like...

var items = table.find('input[id^="entry"]'),

...makes it work as expected again.

[Suggestion] Sidebar position by default

I won't send a pull request unless others agree, but wouldn't it make sense for this field to position itself in the sidebar by default?

Just realised that I change it to sidebar every single time I use it!

Accessing a URL with order entries when logged out

Is this happening to anyone else?

When I've logged out, I accidentally went too far on trying to get back to the symphony login page and got this error:

URL: http://localhost/sym241/symphony-2/symphony/publish/projects/

Symphony Fatal Error: Call to a member function getChildren() on a non-object An error occurred in /Applications/XAMPP/xamppfiles/htdocs/sym241/symphony-2/extensions/order_entries/extension.driver.php around line 70

There doesn't seem to be a check if we're logged in or not right?

Ordering Numbers

Nick

I believe this is a bug, but am open to correction and help!

I'm running Symphony 2.0.6 on Xampp for Windows (XP SP3). I have a section called "entries" in which I use the Order Entries extension.

I went in and created four entries and gave them the corresponding values:

Entry A = 100
Entry B = 200
Entry C = 300
Entry D = 400

Then I realized I needed to put other content (Entry E) prior to Entry A and so I did the following:

Entry E = 50

However, entry E appears after Entry D.

When I do this: Entry E = 30, Entry E appears between Entry B and Entry C. In other words, Entry E = 30 gives the following order:

Entry A = 100
Entry B = 200
Entry E = 30
Entry C = 300
Entry D = 400

I appreciate your labor.

order_entries crashing symphony

hi,

i have downloaded and placed your extension (order_entries) in a clean install of symphony, but i only get a blank white page when i try to enable the extension. the system->extension page is blank.
i'm using symphony 2.2.5 and order_entries 1.10.1

i tried versions 1.10.1 - 1.9.8 and it seems this issue only happens after version 1.9.8

cheers

Undefined data-order-entries-id

Just install the latest Symphony + Order Entries yesterday, no other extensions other than those enabled by default.

After attempting to use the drag and drop I get the following error:

'An error occured while saving the new sort order. Please try again.'

It appears that the "data-order-entries-id" attribute isn't populated on the table. Track this back to the adjustTable method in extension.driver.php and the following lines:

$form = $child->getChildrenByName('table');
$table = $form[0];

For whatever reason, the table is element [1], not [0]. Strangely enough there doesn't even seem to be a first element. Output of print_r on $form shows:

Array (
[1] => XMLElement Object (
[_name:XMLElement:private] => table
[_value:XMLElement:private] => Array (
)
[_attributes:XMLElement:private] => Array (
[class] => selectable
[role] => directory
[aria-labelledby] => symphony-subheading
[data-interactive] => data-interactive
)

etc ...

Pagination not working after uninstalling extension

Hi Nick,
I am not sur if this issue is caused by the order-entries extension.
But i had the order-entries extensions installed and after uninstalling the extension, pagination is not working anymore in the publish page.
I am running symphony 2.3 and order entries 1.10.1

order_entries.publish.js not loaded

On a fresh Symphony CMS 2.3.2 installation version 1.10.1 doensn’t seem to work. No errors, installation and adding to a section works fine, but drag/drop functionality is missing. Apparently order_entries.publish.js is not loaded for the entry list. What could be the reason for this?

Hide on publish page not working 2.6.4

The field that used to show an editable number in the publish page is now hidden all the time, with the option box checked or not in the section editor.

Sym 2.6.4 clean install but having installed an older version of Order Entries momentarily prior to current master branch. IDK if that makes a difference, all else seems to work fine.

Should sorting entries in "Filtered Views" always start with "1" (again)?

@jonmifsud - While playing around with the latest version of this extension (using filtered ordering for the first time) I wondered if the current behavior is the intended one:

I would have expected that sorting a filtered view (after having set the corresponding field as "filtered ordering"-field) would result in a "subset"-sorting that always starts with "1".
That at least is what this extension was doing before the latest changes and which was a useful behavior for tasks like sorting images for articles and like.

At the moment the first number when sorting a filtered view, seems to be somehow dependent on the lowest number that's currently existing in the filtered subset of entries. So if I start sorting 3 images with the sorting values "4, 8, 9" i get "4, 5, 6" instead of the expected "1, 2, 3".

If I manually change the sorting nr. of the first entry to "1" I actually achive the "1, 2, 3"-sorting, but it looks like a manual change causes quite some chaos in other entries that do not belong to the filteres subset.

I hope this is a bug and not the way this feature is intended to work.
Setup is latest integration branch on S.2.6.3.

Field's preferences not saved

When trying to change order entry's field preferences in a section, selected checkbox options are not being applied, except Display in entries table.

image

No flags are being written in DB:

image

Symphony CMS v2.7.6
Order Entries v2.3.8
PHP v5.5.9
MySQL v5.6.33

Now sure if it has something to do with changed tbl_prefix during Symphony CMS install, which I did for this project.

No errors in logs or console (hope I checked all relevant places).

In all other projects where I use the default db table prefix sym_ everything works fine.

Symphony Fatal Database Error: Can't DROP 'unique'; check that column/key exists

After updating from 2.1.x to 2.2.1 I get the following error while trying to save a section containing sort_order:

Symphony Fatal Database Error: Can't DROP 'unique'; check that column/key exists
An error occurred while attempting to execute the following query
ALTER TABLE `sym_entries_data_48` DROP INDEX `unique`;

Backtrace

[/…/symphony/lib/toolkit/class.mysql.php:515]
    MySQL->__error();
[/…/extensions/order_entries/fields/field.order_entries.php:243]
    MySQL->query();
[/…/extensions/order_entries/fields/field.order_entries.php:276]
    fieldOrder_Entries->updateFilterTable();
[/…/symphony/content/content.blueprintssections.php:787]
    fieldOrder_Entries->commit();
[/…/symphony/content/content.blueprintssections.php:883]
    contentBlueprintsSections->__actionNew();
[/…/symphony/lib/toolkit/class.administrationpage.php:705]
    contentBlueprintsSections->__actionEdit();
[/…/symphony/lib/toolkit/class.administrationpage.php:668]
    AdministrationPage->__switchboard();
[/…/symphony/lib/toolkit/class.administrationpage.php:450]
    AdministrationPage->action();
[/…/symphony/content/content.blueprintssections.php:26]
    AdministrationPage->build();
[/…/symphony/lib/core/class.administration.php:212]
    contentBlueprintsSections->build();
[/…/symphony/lib/core/class.administration.php:490]
    Administration->__buildPage();
[/…/symphony/lib/boot/func.utilities.php:232]
    Administration->display();
[/…/symphony/lib/boot/func.utilities.php:212]
    symphony_launcher();
[/…/index.php:17]
    symphony();

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.0001] SET time_zone = '+02:00';
[0.0021] 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.0006] SELECT SQL_CACHE `name` FROM `sym_extensions` WHERE `status` = 'enabled';
[0.0003] SELECT SQL_CACHE `session_data` FROM `sym_sessions` WHERE `session` = 'c4135e6a72979b8ab6501b0a056a7b79' LIMIT 1;
[0.0003] SELECT SQL_CACHE a.* FROM `sym_authors` AS `a` WHERE `username` = 'goldwiege' ORDER BY a.id ASC LIMIT 1;
[0.0002] UPDATE sym_authors SET `last_seen` = '2015-07-14 09:36:15' WHERE `id` = 1;
[0.0005] SELECT SQL_CACHE * FROM `sym_extensions`;
[0.0006] SELECT SQL_CACHE * FROM `sym_sections_association` AS `sa`, `sym_sections` AS `s` WHERE `sa`.`child_section_id` = 6 AND `s`.`id` = `sa`.`parent_section_id` ORDER BY `s`.`sortorder` ASC;
[0.0003] SELECT SQL_CACHE * FROM `sym_sections_association` AS `sa`, `sym_sections` AS `s` WHERE `sa`.`parent_section_id` = 6 AND `s`.`id` = `sa`.`child_section_id` ORDER BY `s`.`sortorder` ASC;
[0.0006] SELECT SQL_CACHE `s`.* FROM `sym_sections` AS `s` ORDER BY `s`.`sortorder` asc;
[0.0004] SELECT SQL_CACHE `s`.* FROM `sym_sections` AS `s` WHERE `s`.`id` IN (16);
[0.0004] SELECT SQL_CACHE d.pages, d.id FROM `sym_documentation` AS d ORDER BY d.pages ASC;
[0.0002] SELECT SQL_CACHE `id` FROM `sym_sections` WHERE `handle` = 'artikel' LIMIT 1;
[0.0003] UPDATE sym_sections SET `name` = 'Artikel', `handle` = 'artikel', `navigation_group` = 'Inhalte', `hidden` = 'no', `filter` = 'yes', `max_entries` = '0' WHERE `id` = 6;
[0.0004] SELECT SQL_CACHE `id` FROM `sym_fields` WHERE `parent_section` = '6' AND `id` NOT IN ('38', '39', '49', '94', '61', '46', '80', '82', '44', '45', '211', '41', '42', '50', '62', '63', '64', '48');
[0.0001] UPDATE sym_fields SET `label` = 'Deutsch', `element_name` = 'de', `parent_section` = '6', `location` = 'main', `required` = 'no', `type` = 'publish_tabs', `show_column` = 'no', `sortorder` = '0' WHERE `id` = 38;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 38 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_publish_tabs` WHERE `field_id` = 38 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_publish_tabs` (`field_id`) VALUES ('38');
[0.0001] UPDATE sym_fields SET `label` = 'Titel (de)', `element_name` = 'titel-de', `parent_section` = '6', `location` = 'main', `required` = 'yes', `type` = 'input', `show_column` = 'yes', `sortorder` = '1' WHERE `id` = 39;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 39 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_input` WHERE `field_id` = 39 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_input` (`validator`, `field_id`) VALUES (null, '39');
[0.0001] UPDATE sym_fields SET `label` = 'Text (de)', `element_name` = 'text-de', `parent_section` = '6', `location` = 'main', `required` = 'yes', `type` = 'textarea', `show_column` = 'no', `sortorder` = '2' WHERE `id` = 49;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 49 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_textarea` WHERE `field_id` = 49 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_textarea` (`formatter`, `size`, `field_id`) VALUES ('markdown_extra_with_smartypants', '15', '49');
[0.0001] UPDATE sym_fields SET `label` = 'Website', `element_name` = 'bereich', `parent_section` = '6', `location` = 'sidebar', `required` = 'yes', `type` = 'association', `show_column` = 'yes', `sortorder` = '3' WHERE `id` = 94;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 94 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_association` WHERE `field_id` = 94 LIMIT 1;
[0.0002] INSERT INTO `sym_fields_association` (`field_id`, `related_field_id`, `allow_multiple_selection`, `hide_when_prepopulated`, `limit`) VALUES ('94', '52', 'no', 'no', '20');
[0.0002] DELETE FROM sym_sections_association WHERE `child_section_field_id` = 94 OR `parent_section_field_id` = 94;
[0.0003] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(52);
[0.0004] SELECT SQL_CACHE * FROM `sym_fields_input` WHERE `field_id` IN (52);
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(94);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (94);
[0.0002] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 94;
[0.0002] INSERT INTO `sym_sections_association` (`parent_section_id`, `parent_section_field_id`, `child_section_id`, `child_section_field_id`, `hide_association`, `interface`, `editor`) VALUES ('7', '52', '6', '94', 'no', 'aui-selector', null);
[0.0002] UPDATE sym_fields SET `label` = 'Navigationspunkt', `element_name` = 'nav', `parent_section` = '6', `location` = 'sidebar', `required` = 'yes', `type` = 'association', `show_column` = 'yes', `sortorder` = '4' WHERE `id` = 61;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 61 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_association` WHERE `field_id` = 61 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_association` (`field_id`, `related_field_id`, `allow_multiple_selection`, `hide_when_prepopulated`, `limit`) VALUES ('61', '60', 'no', 'no', '20');
[0.0002] DELETE FROM sym_sections_association WHERE `child_section_field_id` = 61 OR `parent_section_field_id` = 61;
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(60);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_reflection` WHERE `field_id` IN (60);
[0.0003] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(61);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (61);
[0.0002] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 61;
[0.0002] INSERT INTO `sym_sections_association` (`parent_section_id`, `parent_section_field_id`, `child_section_id`, `child_section_field_id`, `hide_association`, `interface`, `editor`) VALUES ('5', '60', '6', '61', 'no', 'aui-selector', 'aui-editor-new');
[0.0001] UPDATE sym_fields SET `label` = 'Veröffentlicht', `element_name` = 'veroeffentlicht', `parent_section` = '6', `location` = 'sidebar', `required` = 'no', `type` = 'checkbox', `show_column` = 'yes', `sortorder` = '5' WHERE `id` = 46;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 46 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_checkbox` WHERE `field_id` = 46 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_checkbox` (`default_state`, `field_id`) VALUES ('on', '46');
[0.0001] UPDATE sym_fields SET `label` = 'Ist nur Navigationspunkt', `element_name` = 'nur-nav', `parent_section` = '6', `location` = 'sidebar', `required` = 'no', `type` = 'checkbox', `show_column` = 'yes', `sortorder` = '6' WHERE `id` = 80;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 80 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_checkbox` WHERE `field_id` = 80 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_checkbox` (`default_state`, `field_id`) VALUES ('off', '80');
[0.0001] UPDATE sym_fields SET `label` = 'Großbild/er (über dem Haupttext)', `element_name` = 'grossbild', `parent_section` = '6', `location` = 'sidebar', `required` = 'no', `type` = 'association', `show_column` = 'no', `sortorder` = '7' WHERE `id` = 82;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 82 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_association` WHERE `field_id` = 82 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_association` (`field_id`, `related_field_id`, `allow_multiple_selection`, `hide_when_prepopulated`, `limit`) VALUES ('82', '28', 'yes', 'no', '20');
[0.0002] DELETE FROM sym_sections_association WHERE `child_section_field_id` = 82 OR `parent_section_field_id` = 82;
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(28);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_reflection` WHERE `field_id` IN (28);
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(82);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (82);
[0.0002] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 82;
[0.0001] INSERT INTO `sym_sections_association` (`parent_section_id`, `parent_section_field_id`, `child_section_id`, `child_section_field_id`, `hide_association`, `interface`, `editor`) VALUES ('3', '28', '6', '82', 'no', 'aui-selector-sortable', 'aui-editor-new');
[0.0001] UPDATE sym_fields SET `label` = 'Bilder', `element_name` = 'bilder', `parent_section` = '6', `location` = 'sidebar', `required` = 'no', `type` = 'association', `show_column` = 'no', `sortorder` = '8' WHERE `id` = 44;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 44 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_association` WHERE `field_id` = 44 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_association` (`field_id`, `related_field_id`, `allow_multiple_selection`, `hide_when_prepopulated`, `limit`) VALUES ('44', '28', 'yes', 'no', '20');
[0.0001] DELETE FROM sym_sections_association WHERE `child_section_field_id` = 44 OR `parent_section_field_id` = 44;
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(44);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (44);
[0.0002] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 44;
[0.0001] INSERT INTO `sym_sections_association` (`parent_section_id`, `parent_section_field_id`, `child_section_id`, `child_section_field_id`, `hide_association`, `interface`, `editor`) VALUES ('3', '28', '6', '44', 'no', 'aui-selector-sortable', 'aui-editor-new');
[0.0002] UPDATE sym_fields SET `label` = 'Downloads', `element_name` = 'downloads', `parent_section` = '6', `location` = 'sidebar', `required` = 'no', `type` = 'association', `show_column` = 'no', `sortorder` = '9' WHERE `id` = 45;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 45 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_association` WHERE `field_id` = 45 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_association` (`field_id`, `related_field_id`, `allow_multiple_selection`, `hide_when_prepopulated`, `limit`) VALUES ('45', '33', 'yes', 'no', '20');
[0.0002] DELETE FROM sym_sections_association WHERE `child_section_field_id` = 45 OR `parent_section_field_id` = 45;
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(33);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_reflection` WHERE `field_id` IN (33);
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(45);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (45);
[0.0002] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 45;
[0.0002] INSERT INTO `sym_sections_association` (`parent_section_id`, `parent_section_field_id`, `child_section_id`, `child_section_field_id`, `hide_association`, `interface`, `editor`) VALUES ('4', '33', '6', '45', 'no', 'aui-selector-sortable', 'aui-editor-new');
[0.0002] UPDATE sym_fields SET `label` = 'Karte', `element_name` = 'geo', `parent_section` = '6', `location` = 'sidebar', `required` = 'no', `type` = 'association', `show_column` = 'no', `sortorder` = '10' WHERE `id` = 211;
[0.0002] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 211 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_association` WHERE `field_id` = 211 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_association` (`field_id`, `related_field_id`, `allow_multiple_selection`, `hide_when_prepopulated`, `limit`) VALUES ('211', '179', 'yes', 'no', '20');
[0.0002] DELETE FROM sym_sections_association WHERE `child_section_field_id` = 211 OR `parent_section_field_id` = 211;
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(179);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_input` WHERE `field_id` IN (179);
[0.0002] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(211);
[0.0002] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (211);
[0.0002] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 211;
[0.0001] INSERT INTO `sym_sections_association` (`parent_section_id`, `parent_section_field_id`, `child_section_id`, `child_section_field_id`, `hide_association`, `interface`, `editor`) VALUES ('19', '179', '6', '211', 'no', 'aui-selector', 'aui-editor-new');
[0.0001] UPDATE sym_fields SET `label` = 'Englisch', `element_name` = 'en', `parent_section` = '6', `location` = 'main', `required` = 'no', `type` = 'publish_tabs', `show_column` = 'no', `sortorder` = '11' WHERE `id` = 41;
[0.0002] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 41 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_publish_tabs` WHERE `field_id` = 41 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_publish_tabs` (`field_id`) VALUES ('41');
[0.0002] UPDATE sym_fields SET `label` = 'Titel (en)', `element_name` = 'titel-en', `parent_section` = '6', `location` = 'main', `required` = 'no', `type` = 'input', `show_column` = 'yes', `sortorder` = '12' WHERE `id` = 42;
[0.0002] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 42 LIMIT 1;
[0.0002] DELETE FROM `sym_fields_input` WHERE `field_id` = 42 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_input` (`validator`, `field_id`) VALUES (null, '42');
[0.0002] UPDATE sym_fields SET `label` = 'Text (en)', `element_name` = 'text-en', `parent_section` = '6', `location` = 'main', `required` = 'no', `type` = 'textarea', `show_column` = 'no', `sortorder` = '13' WHERE `id` = 50;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 50 LIMIT 1;
[0.0002] DELETE FROM `sym_fields_textarea` WHERE `field_id` = 50 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_textarea` (`formatter`, `size`, `field_id`) VALUES ('markdown_extra_with_smartypants', '15', '50');
[0.0002] UPDATE sym_fields SET `label` = 'Leichte Sprache', `element_name` = 'ls', `parent_section` = '6', `location` = 'main', `required` = 'no', `type` = 'publish_tabs', `show_column` = 'no', `sortorder` = '14' WHERE `id` = 62;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 62 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_publish_tabs` WHERE `field_id` = 62 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_publish_tabs` (`field_id`) VALUES ('62');
[0.0001] UPDATE sym_fields SET `label` = 'Titel (ls)', `element_name` = 'titel-ls', `parent_section` = '6', `location` = 'main', `required` = 'no', `type` = 'input', `show_column` = 'yes', `sortorder` = '15' WHERE `id` = 63;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 63 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_input` WHERE `field_id` = 63 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_input` (`validator`, `field_id`) VALUES (null, '63');
[0.0001] UPDATE sym_fields SET `label` = 'Text (ls)', `element_name` = 'text-ls', `parent_section` = '6', `location` = 'main', `required` = 'no', `type` = 'textarea', `show_column` = 'no', `sortorder` = '16' WHERE `id` = 64;
[0.0001] SELECT SQL_CACHE `type` FROM `sym_fields` WHERE `id` = 64 LIMIT 1;
[0.0001] DELETE FROM `sym_fields_textarea` WHERE `field_id` = 64 LIMIT 1;
[0.0001] INSERT INTO `sym_fields_textarea` (`formatter`, `size`, `field_id`) VALUES ('markdown_extra_with_smartypants', '15', '64');
[0.0001] UPDATE sym_fields SET `label` = 'Reihenfolge', `element_name` = 'reihenfolge', `parent_section` = '6', `location` = 'sidebar', `required` = 'no', `type` = 'order_entries', `show_column` = 'no', `sortorder` = '17' WHERE `id` = 48;
[0.0246] SHOW COLUMNS FROM sym_entries_data_48 WHERE Field like 'field_%';;
[0.0802] ALTER TABLE `sym_entries_data_48` DROP COLUMN `field_94`;
[0.0873] ALTER TABLE `sym_entries_data_48` ADD COLUMN `field_`varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL;

False order in DS

Using the most recent order_entries version on Symphony 2.6.2 gives me a wrong order when sorting by this field in the DS. E. g. a set of entries with order numbers

3, 4, 5

becomes

3, 5, 4

in the DS-output.

Fatal error

Fatal error: Class extension_... contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Extension::about) in C:\xampp\htdocs\xampp\symphony\extensions\order_entries\extension.driver.php on line 81

2.3 compatibility: wrong argument type

Using Order Entries on the current developent branch of Symphony 2.3, I see the following error in the frontend:

Symphony Fatal Error: Argument `$value` is not of type `string`, given `integer`.

An error occurred in /www/htdocs/v301321/test.vhs-suedost.de/symphony/lib/toolkit/class.general.php around line 1361

1356                     throw new InvalidArgumentException(__('Enforced type `%1$s` for argument `$%2$s` does not match any known variable types.', array($param['type'], $name)));
1357                 }
1358
1359                 // validate variable type
1360                 if( !call_user_func($validator, $param['var']) ){
1361                     throw new InvalidArgumentException(__('Argument `$%1$s` is not of type `%2$s`, given `%3$s`.', array($name, $param['type'], gettype($param['var']))));
1362                 }
1363
1364             }
1365         }

I quick-fixed this by casting the integer as a string in line 109:

(string)(strlen($value) != 0 ? $value : ++$max_position["max"]),

That's not very elegant though. :-)

Re-ordering works only once

Using Symphony 2.0.3 and today's version of the order_entries extension, re-ordering works only once. If you try a second re-ordering operation (without reloading the publish page in between), it won't actually work (while your publish page tells you it did work).

So consecutive re-ordering operations require a manual reload of the publish page after each operation.

Error when saving sort order

The field works when entering values manually in the entry itself; however when changing the sort order via the drag-and-drop method on the table view I'm getting the following error:

An error occured [sic] while saving the new sort order. Please try again.

Suffice to say that trying again doesn't help :) I've used the extension quite a bit and never seen this problem, my only guess is a 2.4 compatibility thing?

There was a problem rendering this page. Please check the activity log for more details.

Hi Nick,

I am using Order Entries and the latest (website download) release of symphony 2.3. Under the following conditions it is impossible to add an entry to a section:

  1. Section has no entries.
  2. Order entries is the first field in the Sections.

An error message appears at the top of the page after (unsuccessfully) creating the new entry:

There was a problem rendering this page. Please check the activity log for more details.

And the log error is:

User Error: GenericErrorHandler 256 - The section associated with the data source could not be found. in file /home/wyldemag/webapps/dnewton_php53/symphony/lib/toolkit/data-sources/class.datasource.section.php on line 347

Which is roughly around:

if(!$section = SectionManager::fetch((int)$this->getSource())){

Sorry to be of no help other than catching this issue. The workaround is simply to have Order Entries as the second field of a section when adding the section's first entry.

Thanks,
Ross

Dragging first entry doesn't work.

Dragging first entry doesn't work. Console shows error:

target.prev().offset() is null
movable.min = Math.min...t.prev().offset().top || -Infinity));

Increment after update

The extension always increments the order of the following entries after an update, I think this is only necessary after a new entry creation to avoid order gaps and involutary re-ordenations, for exemple if do you edit an entry after use a SBL link.

Class extension_order_entries : abstract method about() not declared

Hi,

I downloaded the last version of Order Entries, but the about() method in extension.driver.php was removed (your commit comment says "Updated for S2.3").

But since I have the latest stable release of Symphony (2.2.5), it creates a fatal error when, after putting the folder in extensions/, I go for the first time to the Extensions page.

Error:
Fatal error: Class extension_order_entries contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Extension::about) in C:\Users***\extensions\order_entries\extension.driver.php on line 81

Is it a bug, or is the last version of Order Entries not compatible with S2.2.5?

Thank you

Filtered Sorting + Hidden Order Column

Maybe this is something @jonmifsud could have a look into:
If you sort entries in filtered views, everything works fine as long as the column of the Order Entries field is shown in the section index. If the column is hidden the sort order gets scrambled randomly.

My guess is that the extension is relying on the column in the markup as storage but I haven't looked into. If that's the problem the current sorting order needs to be stored on the row instead to make it possible again to hide Order Entries columns.

Error with mySQL 5.7.x

Symphony Fatal Database Error: Expression #1 of ORDER BY clause is not in SELECT list, references column '….s.sortorder' which is not in SELECT list; this is incompatible with DISTINCT

Page::getContext does not always exists

Line 54 in extension.driver.php should be

$context = method_exists(Symphony::Engine()->Page, 'getContext') ? Symphony::Engine()->Page->getContext() : array();

Order saving error when xsrf enabled

When enable_xsrf is enabled in Symphony's config.php file, dragging index entries to reorder them results in an error:

An error occured while saving the new sort order. Please try again.

The .../extension/order_entries/save/?items[22]=1&items[16]=2...&xsrf=RDFnI%2FSxr2OgAh0WR0uK%2BU%2BBxnE ajax call respond with a HTTP 500.

Disabling the xsrf setting in config file restores the functionality.

Symphony v2.6.7, Order Entries v2.3.3.

Does not show on entries table

No matter what I do, I cannot get this extension to display on the entries table. Also, the option to Disable sorting of other columns when enabled has no effect — so now I'm stuck, there's no way to sort by the Order column, because it cannot be displayed.

Sad Tony is sad, and you should feel sad too.

Drag to reorder doesn't always appear

Steps to reproduce:

  • Create a section
  • Populate this section
  • Edit Section and add Order Entries with
    • Display field’s value in entries table unchecked
    • Hide this field on publish page checked
  • Go through each entry and save this again to update the entry order numeric value
  • Drag to reorder will only appear if you
    • Display field’s value in entries table == checked
    • Click on arrow to sort on column Order Entries

Version:
Symphony 2.2.3

Undefined field query string value in sorting causing error.

I'm testing integration branch of Order Entries with 2.4rc2 and kept getting an error 500 when attempting to order the entries.

I've tracked it down to this line: https://github.com/symphonists/order_entries/blob/integration/extension.driver.php#L72

To resolve the error, I changed $table = $form[0] to $table = $form[1]

The page re-ordering then started to work as I think it found the correct array to attach the attributes to the table element.

Not sure why this is the case though? I'm using Chrome on a mac.

Misleading version number

I had some problems with this extension not working on a brand new install of Symphony 2.0.3 Turned out that I was using an older v1.5 download (which was compatible with Symphony 2.0.2 only).

It would help if the Version number of the current (2.0.3 compatible) code was changed to 1.6!

JS not kicking in if there is a hyphen in section title

Crazily on a 2.2.5 install with compatible Order Entries I seem to be encountering a situation where sections with a single word such as 'news' or 'work' have the js for ordering entries kicking in.. but Sections such as 'Our Team' (our-team) in the url context or 'What we do' (what-we-do) don't seem to get the JS...

All sections have the same setup as News and Work in terms of the settings for order entries... anyone else experiencing this?

After deleting one entry all order values turn to 0

In a new installation I experience a problem I never had. When deleting an entry (from a filtered view) that has been ordered through an order_entries field, the order number of all entries of that filtered view (and only of it) turn to 0. I did not activate filtered ordering and I forced manual ordering. My version is 2.3.7.

Save Section throws error when removing field selection from "Filtered Ordering"

@jonmifsud - I was just trying out the new "filtered ordering"-feature in a new project (latest integration-branch in S2.6.3) and got the following error when trying to remove a previously saved field from the new "filtered ordering"-setting:

Symphony Fatal Database Error: Duplicate entry '11' for key 'unique'
An error occurred while attempting to execute the following query
ALTER TABLE `sym_entries_data_30` DROP COLUMN `field_23`

Apart from the error-message, everything looks ok. The Selection has been removed after reloading the page.

Force order with certain conditions

When Display field’s value in entries table is unchecked and section is already sorted by some field, there is no way for client to activate ordering feature.

For example : i want to make some section 'orderable' and not sortable by any other field. In this case order id field considered as internal (hidden from customer/manager) and ordering must be always enabled.

Trouble getting this to work

I've inherited a project where loads of sections already exist, some with this in place and working. Problem I'm having is that I have added the field into another section, ticked the boxes in the settings panel to match the other sections' settings, yet it is having no effect on the section.

It still works perfectly on all the others, but not this one...

Have you seen this behaviour before?

Amok reordering on index reload

I get weird behavior on a site running Symphony 2.6.7and Order Entries 2.3.3. After reloading the index page the order is totally borked.

These are my section settings (no filtered ordering):

bildschirmfoto 2016-03-02 um 15 34 58

This is the List after reordering manually:

bildschirmfoto 2016-03-02 um 15 36 03

When I then reload the page the order is totally shuffled:

bildschirmfoto 2016-03-02 um 15 36 15

Inline scripts should be avoided

The extension driver adds an inline script to the head of the page:

// add pagination and filter data into symphony context if Symphony does not provide it
Administration::instance()->Page->addElementToHead(
	new XMLElement(
		'script', 
		'if (! Symphony.Context.get(\'env\').pagination) Symphony.Context.get(\'env\').pagination='.json_encode($pagination).';' .
		'if (! Symphony.Context.get(\'env\').filters) Symphony.Context.get(\'env\').filters='.json_encode($generatedFilters).';'
		, array(
			'type' => 'text/javascript'
		)
	)
);

This should be avoided. If you use Content Security Policy HTTP headers, you will always attempt to limit the allowed script sources as much as possible, avoiding inline scripts at all costs. (Security evaluation websites like https://observatory.mozilla.org will blame you for allowing inline scripts because this enables special attack vectors.)

Is there any reason why the snippet above has not simply been added to assets/order_entries.publish.js?

Fails with latest Symphony

You probably are already aware, but the order_entries extension no longer allows you to order entries by dragging due to the replacement of the old javascript library with jQuery in the latest Symphony.

entry_order isn't changing

Hello nick,

In order to this extension works the entry_order on sym_sections must be set, right? I think your code doesn't do that or am I wrong?

I changed the entry_order value manually to make it works. Can you fix that, please?

Thanks!

Field can break output completely if included in datasource

I had some problems with frontend administration pages that suddenly broke with the following error:

strlen() expects parameter 1 to be string, array given
/var/www/maschine/symphony/lib/toolkit/class.xmlelement.php line 592

587             }
588         }
589
590         $numberOfchildren = $this->getNumberOfChildren();
591
592         if($numberOfchildren > 0 || strlen($this->_value) != 0 || !$this->_selfclosing){
593
594             $result .= '>';
595
596             if(!is_null($this->getValue()) && !$this->_placeValueAfterChildElements) {

I tracked it down. The issue only occurs if you:

  1. include the Entry Order field in datasource output (which you normally don't need; but you do need this if you have frontend admin pages for your your entries)
  2. accidentally have two entries in the position field's database table with the same entry_id

The second one is the interesting one, how can it happen at all?

In my eyes the underlying issue is in the fields's createTable() function, which says:

KEY `entry_id` (`entry_id`),

It should say:

UNIQUE KEY `entry_id` (`entry_id`),

The latter is what we always do for fields (unless these fields build relations, of course). Am I thinking wrong here? Comments are welcome.

I don't know why Symphony vomits so badly when the above happens, but at the same time I don't think that we must find this Symphony problem (if it is one at all). It has been a very rare issue in my app (which content-wise is completely managed from the frontend using datasources and events), and as far as I remember, it has always been caused by the Entry Order field. I think we should be fine by fixing this extension.

Order entries and Section Associations filtering

Just something I noticed when adding Order Entries to a section connected with an SBL to my main content section.

When you re-order a filtered associated section entries, the order values are re-set to the count of entries in the associated filtered section.

i.e. Section Table index view:

Image|order=1
Image2|order=2
Image3|order=3
Image4|order=4

Filtered by project to only give me:

Image2|order=2
Image3|order=3

When re-ordered while still filtered by project:

Image3|order=1
Image2|order=2

Return to main index of section and you'll see:

Image|order=1
Image3|order=1
Image4|order=2
Image2|order=2

Is there another way of grabbing the value of the table index to get over this? so it only re-orders the numeric order value, rather than the table index' value. Does that make sense?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.