Notice: Undefined index: [...] regexp code on line 1

Help
2014-05-15
2014-05-15
  • Lady Amhäranta

    Lady Amhäranta - 2014-05-15

    Dear all,

    I keep getting the following warning message when I try to show a "Type" column in the list view:

    Notice: Undefined index: Book Chapter in C:\xampp\htdocs\refbase\includes\include.inc.php(5275) : regexp code on line 1

    I have had a look at line 5275 of include.inc.php and discovered that, if I add a @ before $sourceString in that line, the warning message dissapears (but it does not show the type, which is what I want it to display. This just leaves it blank):

    if (preg_match($searchString, $sourceString))
    $sourceString = preg_replace($searchString, $replaceString, $sourceString);

    I have noticed that this warning behaves differently when I am logged in and when I am not logged in. When not logged in, it appears in the list view (column "Type") and at the top of the details view. However, when I am logged in as a normal user, the details view does not show the warning message.

    I have restored the original refbase files in the server to check if it was my fault and, as soon as I modify ini.inc.php to show "Type" in the list view, I get the same warning message, so I suppose it is not related to something I have changed (I have exclusively been messing around with the language files and the text messages in the PHP files).

    For your information, I imported the records from EndNote (just in case this should be of some importance).

    I hope you know why this is happening, because I have no idea and the "Type" column is very important for my project.

    Thank you very much in advance.

     
  • Richard Karnesky

    Thanks for the report. I've fixed this in the bleeding-edge branch. Please upgrade to that version or apply this diff:

    --- search.php (revision 1393)
    +++ search.php (working copy)
    @@ -922,7 +922,7 @@
    // '$searchReplaceActionsArray'.)
    $fieldSpecificSearchReplaceActionsArray = array(
    array(
    - 'fields' => array("thesis", "approved", "marked", "copy", "selected", "type"), // see also note for '$encodingExceptionsArray' below
    + 'fields' => array("thesis", "approved", "marked", "copy", "selected"), // see also note for '$encodingExceptionsArray' below
    'actions' => array("/(.+)/e" => "\$loc['\1']") // use localized field values (e.g., in case of german we display 'ja' instead of 'yes', etc)
    ),
    array(

     
  • Lady Amhäranta

    Lady Amhäranta - 2014-05-15

    Thank you! Now it works!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks