Search

Union Datasource updated to version 0.5.2 on 5th of December 2011

@brendo: The README states:

Datasource dependencies are not taken care of

Does this mean dependencies among included DSs only? Or does this mean dependencies of included DSs?

If it's the latter, I am lost. :-(

The former, I think. If you have a datasource that has a dependency on another datasource in the union, the user must manually order them correctly. While I'm not 100%, I think if the union datasource depends on a datasource not included in the union that this will be handled as normal by Symphony. If not, its a bug and I think I can implement it :)

OK, so I think we have a bug here. I have a datasource which is filtered by the param output of another datasource (the second one NOT being included in the Union Datasource).

When I include the DS in a Union Datasource, it always returns an emtpy result.

I try to filter on a Select Box Field using s.th. like {$ds-something-param-output:0}. If I use an hardcoded ID instead, it works. If I remove :0 from the expression, the DS returns all entries — so it's obvious that the parameter is not resolved at all.

Should I post it on GitHub?

[EDIT]: Symphony 2.2.5, Union DS 0.5.2.

I think I found the problem. :-)

When the Union DS is saved, the constructor function includes an empty dependencies array!

$this->_dependencies = array();

If I change this manually to be

$this->_dependencies = array('$ds-something-param-output');

it works! So the dependency is actually resolved, but the extension simply fails to save it to the union DS file.

I think there are two possible ways to deal with this issue:

  1. As mentioned above, simply copy the existing dependencies to te Union DS's constructor function. In this case it should be clear that dependencies are not "actively" resolved. Each time you change an original Datasource's dependencies, you must resave the Union DS.

  2. Remove the dependencies array from the constructor function and "actively" resolve dependencies for every included DS. At the same time this would probably mean that dependencies between the included Datasources would be resolved correctly as long as the sortorder of DSs is correct. However, I don't know how difficult this solution would be.

[EDIT]: Posted an issue on GitHub which suggests the second solution.

Bump.

@brendo: Do you already know where to go from here? It would be great to know this since I have to decide which solution to implement (for a special client issue).

Haven't really had a chance to look at it just yet sorry. I hope to in the next 48 hours. At this stage I'll be looking to save the dependencies into the union file.

I just need to sort out my local copy, I've moved Union ahead and have been using it as a guinea pig for Providers.

Thanks for the info!

What a great extension!

Ensure only valid Datasources are includable

Any chance of it being compatible with SymQL at some point. I actually don't need it to, just wondering.

Thanks for the great work.

Any chance of it being compatible with SymQL at some point. I actually don't need it to, just wondering.

Nah, it uses the parameters saved against the Datasource to rebuild the grab() functionality. All the joining and unioning happens in the SQL, before any entries are gathered.

Union Datasource updated to version 0.6 on 11th of January 2012

  • Add support for dependencies. Datasources included in a Union Datasource will now resolve dependencies. Resave your existing Union Datasources to unlock this achievement. Fixes #7
  • Fixed an issue where the sort order of Datasources would show incorrectly in the backend. Fixes #5

Thanks a lot, @brendo!

Hello Brendan,

I'm trying to unify two datasources. Everything works well until I try to filter with 'earlier than now' on a Date and Time field (latest version 2.3.2). I get this SQL error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `sym_entries` AS `e` LEFT JOIN `sym_entries_data_24` AS `t24` ON `e`.`' at line 8

SELECT SQL_CACHE `e`.id as id, `e`.section_id, e.`author_id`, UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`, `ed`.`start` FROM `sym_entries` AS `e` LEFT OUTER JOIN `sym_entries_data_17` AS `ed` ON (`e`.`id` = `ed`.`entry_id`) WHERE `e`.`section_id` = 4 UNION ALL SELECT `e`.id as id, `e`.section_id, e.`author_id`, UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`, FROM `sym_entries` AS `e` LEFT JOIN `sym_entries_data_24` AS `t24` ON `e`.`id` = `t24`.entry_id LEFT OUTER JOIN `sym_entries_data_24` AS `ed` ON (`e`.`id` = `ed`.`entry_id`) WHERE `e`.`section_id` = 5 AND (((`t24`.start BETWEEN '1970-01-01 00:00:00' AND '2012-01-18 21:36:58') OR (`t24`.end BETWEEN '1970-01-01 00:00:00' AND '2012-01-18 21:36:58') OR (`t24`.start < '1970-01-01 00:00:00' AND `t24`.end > '2012-01-18 21:36:58'))) ORDER BY `start` desc LIMIT 0, 20

Can you help? Thanks.

Oh that's a strange bug. Do you have that filter on one of your datasources in the union or all of them?

This happen even with the filter on just one of the two, but I have the filter on both.

I can always deal without this filter, I'm just wondering if there is fix for that. Thanks.

Brendo, In the description of this extension, you said:

For instance, you have may have two sections, News and Tweets

Tweets into a section? I'm trying to merge Tweets and News into a single stream, but the only way I know of getting Tweets into a Symphony is through a Dynamic XML datasource and the Twitter REST API. Is there any other way to do it?

Thanks in advance for your insights on the subject.

but the only way I know of getting Tweets into a Symphony is through a Dynamic XML datasource and the Twitter REST API. Is there any other way to do it?

Yep: the XML Importer extension.

Oh! great. Thanks a lot Nick.

I just run into an SQL error when using Union Datasource alongside with Search Index (using the search index field on multiple sections). The bug occurs when searching for a string starting with one or more comma ',' or one or more plus '+'.

Here is the SQL: http://pastie.org/3288516

Should a I log an issue?

Edit: it works fine without the union

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