Menu

Creating default object from empty value, search.php:636

Help
2020-10-08
2021-08-02
  • David Smart

    David Smart - 2020-10-08

    After my recent migration of both db and fresh install of PhpGedView, this popped up.

    Creating default object from empty value, search.php:636

    function printDatabaseSelector()
        global $ALLOW_CHANGE_GEDCOM, $pgv_lang, $TEXT_DIRECTION;
    
        ...
                $controller->inputFieldNames[] = "${str}"; // !!! first appearance of $controller
        ...
    
     
  • Gerry Kroll

    Gerry Kroll - 2020-10-08

    What are you telling me? What are you trying to accomplish?

     
  • David Smart

    David Smart - 2020-10-08

    Ah, sorry - this warning message was visible on my web page (because of the settings for php to show errors). It appears that $controller was not declared global within this function, so then $controller would be a new object local only to this function, and it is then not used in this function.

    I wonder if $controller should be added to the global list for this function.

     

    Last edit: David Smart 2020-10-08
  • Gerry Kroll

    Gerry Kroll - 2020-10-08

    The Search function worked for me without any changes, but I was using PHP 5.4. I was able to select the desired GEDCOM to be searched.

    Exactly what error messages were you getting?

    Try the attached search.php to see whether whatever error message you were getting goes away.

    Let us know what happens.

     
  • Gerry Kroll

    Gerry Kroll - 2020-10-09

    David:
    Did this change fix your problem?

    I'd like to get it into SVN.

     
  • David Smart

    David Smart - 2020-10-09

    Gerry, That appears to be the perfect fix. My original error message:

    Databases to search in  
    ERROR 2: Creating default object from empty value
    0 Error occurred on line 636 of file search.php in function printDatabaseSelector
    1 called from line 166 of file search.php
    Warning: Creating default object from empty value in /volume1/web/gen/search.php on line 636 Call Stack: 0.0002 370296 1. {main}() /volume1/web/gen/search.php:0 0.3881 919000 2. printDatabaseSelector() /volume1/web/gen/search.php:166 
    

    This was followed by checkboxes for each db.

    It looks like I have another item in search.php.
    I was not logged in at the time, and I noticed some data was hidden for privacy reasons. I'm sorry but I don't have time right now to dig deeper on this one.

    ERROR 8: Trying to access array offset on value of type bool
    0 Error occurred on line 601 of file functions_privacy.php in function displayDetailsById
    1 called from line 868 of file functions_privacy.php in function privatize_gedcom
    2 called from line 96 of file class_gedcomrecord.php in function __construct
    3 called from line 78 of file class_person.php in function __construct
    4 called from line 210 of file class_gedcomrecord.php in function getInstance
    5 called from line 1194 of file functions_db.php in function search_indis
    6 called from line 394 of file search_ctrl.php in function GeneralSearch
    7 called from line 284 of file search_ctrl.php in function init
    8 called from line 36 of file search.php
    

    line 36 of search is the "$controller->init();" after applying the changes you proposed.

     

    Last edit: David Smart 2020-10-09
  • Gerry Kroll

    Gerry Kroll - 2020-10-10

    This latest error occurs when doing privacy checks on families that have no recorded parents.

    The attached search.zip should fix this problem. The previous search.zip has been incorporated into this one. No change to the actual file, search.php -- for convenience, the two fixes have been combined into one file.

     
  • David Smart

    David Smart - 2020-10-10

    That's a good change too - as best I can tell. Thanks!

     
  • Gerry Kroll

    Gerry Kroll - 2020-10-10

    SVN has been updated.

     
  • asaas ase

    asaas ase - 2021-08-02

    I observed this with the aid of googling the text of the real blunders message for social (the line underneath "Your modern database configuration is bad. ...".)

     
  • Gerry Kroll

    Gerry Kroll - 2021-08-02

    What are you telling me?

    If you're trying to report an error, please upgrade your PhpGedView installation to the latest-and-greatest "SVN" version first.

    You can download the most recent SVN snapshot from here:
    https://sourceforge.net/p/phpgedview/svn/HEAD/tree/trunk/phpGedView

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.