Page 1 of 1

serendipity_event_filter_entries

Posted: Sun Jul 24, 2005 8:59 pm
by ww_hoax
after installation of event_filter_entries I get first following error if I use the search function:

Warning: preg_match() expects parameter 2 to be string, array given in /home/www/webXXX/html/blog/include/functions.inc.php on line 683

Warning: preg_match() expects parameter 2 to be string, array given in /home/www/webXXX/html/blog/include/functions.inc.php on line 683

Row 679-688 of functions.inc.php

Code: Select all

function serendipity_getUriArguments($uri, $wildcard = false) {
global $serendipity;

    /* Explode the path into sections, to later be able to check for arguments and add our own */
    preg_match('/^'. preg_quote($serendipity['serendipityHTTPPath'], '/') . '(' . preg_quote($serendipity['indexFile'], '/') . '\?\/)?(' . ($wildcard ? '.+' : '[a-z0-9\-*\/%\+]+') . ')/i', $uri, $_res);
    if (strlen($_res[2]) != 0) {
        $args = explode('/', $_res[2]);
        if ($args[0] == 'index') {
            unset($args[0]);
        }
If I search a content following page appear:

Query failed:

SELECT


e.id,
e.title,
e.timestamp,
e.comments,
e.exflag,
e.authorid,
e.trackbacks,
e.isdraft,
e.allow_comments,
e.last_modified,

a.realname AS author,
a.email



FROM
serendipity_entries AS e
LEFT JOIN serendipity_authors a
ON e.authorid = a.authorid
LEFT JOIN serendipity_entrycat ec
ON e.id = ec.entryid
LEFT JOIN serendipity_category c
ON ec.categoryid = c.categoryid

WHERE e.timestamp <= '1122224129' AND e.authorid = '1' AND MATCH (title,body,extended) AGAINST ('dfs')
GROUP BY e.id
ORDER BY timestamp DESC
LIMIT 0, 12

/ Can't find FULLTEXT index matching the column list

Have anybody an idea??

Re: serendipity_event_filter_entries

Posted: Sun Jul 24, 2005 9:46 pm
by garvinhicking
The preg_match error you are getting is really strange.

Could you please edit the snippet you posted and beofre the preg_match enter this:

Code: Select all

echo "URI IS: '" . print_r($uri, true) . "'<br />\n";
And then tell me what your output is. It seems PHP is complaining that one parameter is not a string, but in fact the $uri parameter always needs to be a string.

The SQL error you are getting is because of this:

http://www.s9y.org/forums/viewtopic.php ... text+index
http://www.s9y.info/forums/viewtopic.ph ... text+index
http://www.s9y.org/forums/viewtopic.php ... text+index

:-)

Regards,
Garvin

Posted: Sun Jul 24, 2005 10:00 pm
by ww_hoax
My output:

URI IS: '/plugin/filter/?filter%5Bauthor%5D=&filter%5Bcategory%5D=1&filter%5Bbody%5D=marke&sort%5Border%5D=timestamp&sort%5Bordermode%5D=ASC&sort%5BperPage%5D=12'

Posted: Sun Jul 24, 2005 10:25 pm
by ww_hoax
After

CREATE FULLTEXT INDEX entry_idx ON serendipity_entries(title,body,EXTENDED)

I have also the error message
#1044 - Access denied for user: 'webxx@localhost' to database 'usr_webxx_1'

Fot that I have asked the system administrator.

Many thanks!

Posted: Sun Jul 24, 2005 11:36 pm
by ww_hoax
Now I have done following:

Now I have created the tables via localhost/phpMyAdmin (entry_idx etc.) and then I have imported the complete table serendipity_entries via phpMYAdmin on the server database. It seems the search funtion works, but do you think any problems follow in the future?

Posted: Mon Jul 25, 2005 3:26 pm
by garvinhicking
Yes, you should ask your sysadmin to give your mysql user the "index" and fulltext privilege. The s9y update scripts sometimes need those privileges to add propper indexing.

The other thing about your URL: Do you still get that error? Because it says that $uri is a string and I don't have a clue why it gives you the preg_match error...

Regards,
Garvin

Posted: Mon Jul 25, 2005 9:23 pm
by ww_hoax_!
dear garvinhicking - many thanks for your reply. The sys admin has realized "index" for sql.

yesterday I have ad a "@" before the preg_match function to suppress the warnings.

After the sys admin give sql "index" the warnings no longer appear.

Possibly you can acitvate my account. I have tried three eMail-addresses. I never receive an activation key. I will try it again with a new eMail address and will inform you.

Many thanks!

hm

Posted: Mon Jul 25, 2005 9:30 pm
by Meinhard
Now the registration worked with no problems. I do not know, what was wrong before.
:?

Posted: Tue Jul 26, 2005 9:37 am
by Guest
the warnings appear again:
Warning: preg_match() expects parameter 2 to be string, array given in /home/www/webXXX/html/blog/include/functions.inc.php on line 683

the only one difference to yesterday: I add a new test article.

now I have added a "@" permanently.

Posted: Tue Jul 26, 2005 11:15 pm
by garvinhicking
Maybe you could try to place this before the preg_match:

Code: Select all

if (is_array($uri)) {
$fp = fopen('urilog.log', 'a');
fwrite($fp, 'URI is array: ' . print_r($uri, true) . "\n\n");
fclose($fp);
}
This piece of code will create a logfile called "urilog.log" which you could investigate to see what passed parameters where. If possible you can send me examples of the logfile if it gets filled and I can try to reproduce the bug?

Regards,
Garvin

Posted: Sat Jul 30, 2005 10:26 am
by Meinhard
Sorry for my late answer. I will do so and many thanks for your help :D

I assume that I can leave the "@" before the function. Because I hate Warnings :wink:

Nice weekend

Posted: Sun Jul 31, 2005 10:07 pm
by garvinhicking
Yeah, you can leave the "@", it's just that this shouldn't be a permanent solution. :)

Regards,
Garvin

Posted: Tue Aug 02, 2005 8:01 am
by Meinhard
hm - now I get following error for event_custom_permalinks:

Warning: Invalid argument supplied for foreach() in /home/www/xxx/html/plugins/serendipity_event_custom_permalinks/serendipity_event_custom_permalinks.php on line 96

following error appear in phpmyadmin:
Die Index-Typen INDEX und UNIQUE sollten nicht gleichzeitig für die Spalte `entryid` gesetzt sein

I think the configuration of mysql is not correct. Is there anywhere an overview for the necessary mysql settings which I can send to the server adminsitration?

for your information: on my server@home the warning does not appear.

Posted: Wed Aug 03, 2005 4:53 pm
by garvinhicking
I think you're using an older version of the custom permalink plugin there. My line 96 looks like this:

Code: Select all

                    foreach((array)$retval AS $pl) {
So that error could never happen as we're doing array casting. The version is 1.02 of the plugin.

The MySQL notice of phpMyAdmin is alright; it's just a notice about column indices which are set double, but in our case that's needed.

Regards,
Garvin