gtd-php
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 09, 2010, 02:44:22 AM

Login with username, password and session length
Search:     Advanced search
1756 Posts in 305 Topics by 425 Members
Latest Member: joey_ser33
* Home Help Search Calendar Login Register
+  gtd-php
|-+  gtd-php
| |-+  gtd-php users
| | |-+  Warning: strpos() expects parameter 1 to be strin
« previous next »
Pages: [1] Print
Author Topic: Warning: strpos() expects parameter 1 to be strin  (Read 101 times)
raamklaza
Full Member
***
Posts: 20


View Profile
« on: July 07, 2010, 04:46:30 PM »

I get this error message when i delete or change items.

Warning: strpos() expects parameter 1 to be string, array given in E:\Program Files\Ontwikkeling\Wampserver\www\1-Ontwikkeling\gtd-php-09\processItems.php on line 576

I know some php so what can i do to resolve this issue?

I have gtd-php 0.9

Some relevant code:
Code:
    log_value('referrer',$updateGlobals['referrer']);
    if (strpos($nextURL,'nextId=0')!==false) {
        if (empty($_REQUEST['referrer']) || strpos($_REQUEST['referrer'],'nextId=0')) {
            $_SESSION[$key]=$tst;
            $nextURL='';
        } else {
            $nextURL=str_replace('nextId=0','nextId='.$values['newitemId'],$nextURL);
            $_SESSION[$key]=$tst;
            $_SESSION['message'][]='Creation of this '.getTypes($values['type']).' has been suspended while parent is created';
        }
    }
Logged
Andrew
Administrator
Hero Member
*****
Posts: 375


View Profile
« Reply #1 on: July 12, 2010, 03:41:47 AM »

Please can you turn on debugging (see other thread) and find out what value $_REQUEST['referrer'] has please?
Configure > Preferences > Debugging
and check both boxes:
  • Show detailed debugging information
  • Wait after updating an item, rather than progressing to the next screen automatically
Logged
raamklaza
Full Member
***
Posts: 20


View Profile
« Reply #2 on: July 12, 2010, 04:09:17 AM »

$_REQUEST['referrer'] is not in the list...

But here is the code from the delete item action including error message

Code:
Action here is: delete item 1 - dfdfddf
↑ ↓ Query Label: deleteitemstatus
↑ ↓ Values to be made safe: Array
(
    [itemId] => 1
    [type] =>
)
↑ ↓ Sort array: Array
(
    [categoryselectbox] => `category` ASC
    [getchildren] => `dateCompleted` DESC, `deadline` DESC, `title` ASC
    [getitems] => `title` ASC
    [getitemsandparent] => `type` ASC, `ptitle` ASC, `title` ASC, `deadline` ASC, `dateCreated` DESC
    [getorphaneditems] => `type` ASC, `title` ASC
    [spacecontextselectbox] => `name` ASC
    [timecontextselectbox] => `timeframe` DESC
)
↑ ↓ Query:  DELETE FROM `gtdphp_itemstatus` WHERE `itemId`='1'
↑ ↓ Query Result: 1
↑ ↓ Query Label: deleteitem
↑ ↓ Values to be made safe: Array
(
    [itemId] => 1
    [type] =>
)
↑ ↓ Sort array: Array
(
    [categoryselectbox] => `category` ASC
    [getchildren] => `dateCompleted` DESC, `deadline` DESC, `title` ASC
    [getitems] => `title` ASC
    [getitemsandparent] => `type` ASC, `ptitle` ASC, `title` ASC, `deadline` ASC, `dateCreated` DESC
    [getorphaneditems] => `type` ASC, `title` ASC
    [spacecontextselectbox] => `name` ASC
    [timecontextselectbox] => `timeframe` DESC
)
↑ ↓ Query:  DELETE FROM `gtdphp_items` WHERE `itemId`='1'
↑ ↓ Query Result: 1
↑ ↓ Query Label: deletelookup
↑ ↓ Values to be made safe: Array
(
    [itemId] => 1
    [type] =>
)
↑ ↓ Sort array: Array
(
    [categoryselectbox] => `category` ASC
    [getchildren] => `dateCompleted` DESC, `deadline` DESC, `title` ASC
    [getitems] => `title` ASC
    [getitemsandparent] => `type` ASC, `ptitle` ASC, `title` ASC, `deadline` ASC, `dateCreated` DESC
    [getorphaneditems] => `type` ASC, `title` ASC
    [spacecontextselectbox] => `name` ASC
    [timecontextselectbox] => `timeframe` DESC
)
↑ ↓ Query:  DELETE FROM `gtdphp_lookup` WHERE `itemId` ='1'
↑ ↓ Query Result: 0
↑ ↓ Query Label: deletelookupparents
↑ ↓ Values to be made safe: Array
(
    [itemId] => 1
    [type] =>
)
↑ ↓ Sort array: Array
(
    [categoryselectbox] => `category` ASC
    [getchildren] => `dateCompleted` DESC, `deadline` DESC, `title` ASC
    [getitems] => `title` ASC
    [getitemsandparent] => `type` ASC, `ptitle` ASC, `title` ASC, `deadline` ASC, `dateCreated` DESC
    [getorphaneditems] => `type` ASC, `title` ASC
    [spacecontextselectbox] => `name` ASC
    [timecontextselectbox] => `timeframe` DESC
)
↑ ↓ Query:  DELETE FROM `gtdphp_lookup` WHERE `parentId` ='1'
↑ ↓ Query Result: 0
↑ ↓ referrer

Warning: strpos() expects parameter 1 to be string, array given in E:\Program Files\Ontwikkeling\Wampserver\www\1-Ontwikkeling\gtdphp\processItems.php on line 576
 ↑ ↓ Query Label: selectlastmodified
↑ ↓ Values to be made safe: Array
(
    [itemId] => 1
    [type] =>
)
↑ ↓ Sort array: Array
(
    [categoryselectbox] => `category` ASC
    [getchildren] => `dateCompleted` DESC, `deadline` DESC, `title` ASC
    [getitems] => `title` ASC
    [getitemsandparent] => `type` ASC, `ptitle` ASC, `title` ASC, `deadline` ASC, `dateCreated` DESC
    [getorphaneditems] => `type` ASC, `title` ASC
    [spacecontextselectbox] => `name` ASC
    [timecontextselectbox] => `timeframe` DESC
)
↑ ↓ Query:  SELECT UNIX_TIMESTAMP(`lastModified`) AS `lastModified`
                    ,`lastModified` AS `lmreal`
                    FROM `gtdphp_itemstatus`
                    WHERE `itemId` = '1'
↑ ↓ Query Result: 0
Logged
Andrew
Administrator
Hero Member
*****
Posts: 375


View Profile
« Reply #3 on: July 12, 2010, 04:52:41 AM »

I can't reproduce this, or work out why it's doing what it's doing.

But this might fix it:
in processItems.php , change line 572
from
Code:
$nextURL=$tst;
to
Code:
$nextURL = (is_array($tst)) ? $tst[0] : $tst;
Logged
raamklaza
Full Member
***
Posts: 20


View Profile
« Reply #4 on: July 12, 2010, 05:46:26 AM »

Now it works without an error message.

Thnx
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!