View Issue Details

IDProjectCategoryView StatusLast Update
391RackTablesdefaultpublic2011-02-14 16:59
Reporteruser200Assigned Toandriyanov  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.19.0 
Target Version0.19.1Fixed in Version0.19.1 
Summary391: Exact Searches now returning no results and not auto directing to object
DescriptionWhen searching for an object by exact name no results are returned
TagsNo tags attached.

Activities

infrastation

infrastation

2011-02-14 12:27

administrator   ~0000238

I cannot reproduce this problem. Could you describe it in more details?

user200

2011-02-14 12:35

  ~0000239

Hi I'm new to mantis so may have missed an import point. This is with a test install of 0.19 beta with a copy of our live 18.6 DB as the base install.

Basically on 18.6 and below if we searched for a device by name "eg router1" and that device existed it would take you straigh to the object page. Now it seems to show no results. I think the redirect is probably broke or something.
infrastation

infrastation

2011-02-14 13:19

administrator   ~0000240

I have tried this kind of search on my database and it works like before. Are there any relevant messages in server error log?

user200

2011-02-14 14:11

  ~0000241

Ok done a little digging and seems to be an issues with php "key" function or the summary data not sure which at min.

/inc/interface.php ~Line 3752

$realm = key($summary);
$record = current($summary);
print_r($summary);
print "Realm=$realm";
print_r(array_keys($summary));

Output below:
Array ( [object] => Array ( [236] => Array ( [id] => 236 [by_attr] => Array ( [0] => name ) ) ) )
Realm=
Array ( [0] => object )

Will continue to investigate.

Setup is Centos 5.5 php 5.1.6

user200

2011-02-14 15:18

  ~0000243

Tried a vanila install of 0.19.0 and have the same issue. Created a test object and search for test and get back a blank search page. Redirect to object fails.
andriyanov

andriyanov

2011-02-14 15:59

reporter   ~0000244

Could you please try the following patch? If it is helpful, I'll merge it into trunk. Unfortunately I can not reproduce this issue on my PHP installation, so your help will be appreciated.

Simply save it into a file, change dir to your racktables root (where Changelog file persist) and execute the command
patch < /path/to/patch.file

Index: wwwroot/inc/interface.php
===================================================================
--- wwwroot/inc/interface.php (revision 4222)
+++ wwwroot/inc/interface.php (working copy)
@@ -3780,10 +3780,8 @@
        echo "<center><h2>Nothing found for '${terms}'</h2></center>";
    elseif ($nhits == 1)
    {
- $realm = key ($summary);
- $record = current ($summary);
- if (is_array ($record))
- $record = current ($record);
+ foreach ($summary as $realm => $container)
+ $record = array_shift ($container);
        switch ($realm)
        {
            case 'ipv4addressbydq':

user200

2011-02-14 16:06

  ~0000245

Yeah that has worked a treat. Must be a version specific issue somewhere.
andriyanov

andriyanov

2011-02-14 16:52

reporter   ~0000246

This issue will be fixed in the final release of 0.19.0.

The change is in SVN now.
infrastation

infrastation

2011-02-14 16:59

administrator   ~0000247

The fix will be available through 0.19.1 release. Thanks to all.

Issue History

Date Modified Username Field Change
2011-02-14 11:09 user200 New Issue
2011-02-14 12:26 infrastation Status new => assigned
2011-02-14 12:26 infrastation Assigned To => infrastation
2011-02-14 12:27 infrastation Note Added: 0000238
2011-02-14 12:27 infrastation Status assigned => feedback
2011-02-14 12:35 user200 Note Added: 0000239
2011-02-14 13:19 infrastation Note Added: 0000240
2011-02-14 13:19 infrastation Product Version => 0.19.0
2011-02-14 14:11 user200 Note Added: 0000241
2011-02-14 14:59 andriyanov Status feedback => assigned
2011-02-14 14:59 andriyanov Assigned To infrastation => andriyanov
2011-02-14 15:18 user200 Note Added: 0000243
2011-02-14 15:59 andriyanov Note Added: 0000244
2011-02-14 16:06 user200 Note Added: 0000245
2011-02-14 16:52 andriyanov Note Added: 0000246
2011-02-14 16:52 andriyanov Status assigned => closed
2011-02-14 16:52 andriyanov Resolution open => fixed
2011-02-14 16:52 andriyanov Fixed in Version => 0.19.0
2011-02-14 16:59 infrastation Note Added: 0000247
2011-02-14 16:59 infrastation Fixed in Version 0.19.0 => 0.19.1
2011-02-14 16:59 infrastation Target Version => 0.19.1