Search

DS code: data.alarms.php:

<?php

require_once(TOOLKIT . '/class.datasource.php');

    Class datasourceAlarms extends Datasource{

        function about(){
            return array(
                   "blah":"blah :)"
        }

        function grab(&$param_pool){

            $tag_list_id = "83";
            $result = new XMLElement("alarms");

            $tags = $this->_Parent->Database->fetch("
               SELECT DISTINCT (
               handle
               ), COUNT( handle ) AS count, value
               FROM sym_entries_data_83
               WHERE `entry_id`
               IN (
                   SELECT `entry_id`
                   FROM sym_entries_data_76
                   WHERE `value` = 'yes'
                   AND `entry_id`
                   IN (
                       SELECT DISTINCT `entry_id`
                       FROM sym_entries_data_75
                       WHERE `handle` = 'blah'
                   )
               )
               GROUP BY handle
               ORDER BY handle ASC
           ");

            foreach($tags as $tag){
                $tag_node = new XMLElement("ras", $tag["value"]);
                $tag_node->setAttributeArray(array("handle" => $tag["handle"], "count" => $tag["count"]));
                $result->appendChild($tag_node);
            }

            return $result;
        }
    }

?>

I got error:

12:52:47 > WARNING: 2 - array_intersect() [function.array-intersect]: Argument #2 is not an array in file /symphony/lib/toolkit/class.frontendpage.php on line 338
12:52:47 > WARNING: 2 - Invalid argument supplied for foreach() in file /workspace/data-sources/data.alarms.php on line 25

When I remove this part of query string:

AND `entry_id` IN (SELECT `entry_id` FROM sym_entries_data_75 WHERE `handle` = 'blah')

—everything works correctly.

PHPMyAdmin can execute both queries without errors.

Please, help!

I think this was fixed with last changes to selectboxlinkfield extension. That warning looks very similar to the one which was fixed. Please check if symentriesdata75 is table for selectboxlink field, and if it is download latest version of extension from github.

No, symentriesdata75 isn't for selectboxlink field ://

It's for taglist field:

sym_entries_data_75—taglist field
sym_entries_data_76—checkbox
sym_entries_data_83—selectbox field

Any other ideas?

Could it be the very first SELECT from symentriesdata_83 (select box link) where you're trying to select handle/value. I'm pretty sure those fields don't exist in a SBL table. This looks based on my original tag values DS which only attempts to query these from a tag list table.

@nickdunn: Sorry, probably my english is too poor, but I can't understand what should I do to make it work? :)

As a result, I created mysql view and: SELECT * FROM myview :)

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