DS breaking because a URL param is not set
This is an open discussion with 4 replies, filed under General.
Search
More info:
In the log I get the following information:
============================================ Log Created: 2010-05-05T15:33:39-04:00 ============================================ Symphony Log Version: 2.0.7 -------------------------------------------- 2010/05/05 15:33:40 > WARNING: 2 - array_intersect() [<a href='function.array-intersect'>function.array-intersect</a>]: Argument #2 is not an array in file /Users/doug/Projects/Goodbuy Timeshare/201005 Site Maintenance/Web Files/Alpha Site/symphony/lib/toolkit/class.frontendpage.php on line 427
Corresponding function in class.frontpage.php
is:
foreach($dependenciesList as $handle => $dependencies){ $dependenciesList[$handle] = @array_intersect($dsKeyArray, $dependencies); if(empty($dependenciesList[$handle])){ unset($dependenciesList[$handle]); $orderedList[] = str_replace('_', '-', $handle); } }
This is a problem with your DS since the XML returns an SQL error.
As you mentioned, the error occurs when the parameters have no value so the first thing I would consider doing is to make sure there’s always a value.
Have you tried using enumeration to set a default?
mysql: value >= {$url-min:10} AND value <= {$url-max:100}
Outstanding! I was wondering what the solution was for that. This will also allow me to simplify things a bit. If it automatically has a default it means I don’t need to switch between two datasources.
Allan, you rock.
…I just realized, I can possibly simplify things quite a bit more than that as well!
@Allen beat me to it… lol
Create an account or sign in to comment.
I’m using two datasources on my site. The idea is that when certain URL parameters are set one datasource is used otherwise it uses a different datasource.
The datasource that tests for a min/max is using this code:
When these values aren’t set the page returns this error:
When I debug the page and look in the XML I get the following error:
I played around with my XSLT and there seems to be nothing I can do to make it work so it must be a datasource error. How can I make it behave, short of removing that filter, which I have to have?
I should note that in my XSLT I did try writing this:
But it didn’t help.