ZF-3528: Fatal error: Call to a member function createFile() on a non-object

Issue Type: Bug Created: 2008-06-27T08:01:56.000+0000 Last Updated: 2012-05-05T03:01:22.000+0000 Status: Closed Fix version(s): Reporter: Ian (neoform) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Search_Lucene

  • zf-caretaker-adamlundrigan
  • zf-crteam-padraic
  • zf-crteam-priority

Related issues: Attachments:


I get the following error:

Fatal error: Call to a member function createFile() on a non-object in D:\websites\\core_lib\Zend\Search\Lucene\LockManager.php on line 56

when I run this code:

    public function delete($item_id)
        $hits = $this->lucene->find('product_id:'.$item_id);
        $hit_count = count($hits);
        if ($hit_count)
            foreach ($hits as &$hit)
            { $this->lucene->delete($hit->id); 

        return $hit_count;

This error only seems to happen when there's an indexed item that needs to be deleted. when there's 0 results matched, no error.

I'm using wind2k3 standard with php 5.2.6


Posted by Aleksander Wons (xelah) on 2009-01-14T00:53:13.000+0000

I have similar issue to ZF-3528.


public static function deleteSingleGroupTags($boardID, $index) { $term = new Zend_Search_Lucene_Index_Term($boardID, 'boardID'); $query = new Zend_Search_Lucene_Search_Query_Term($term); $hits = array(); $hits = $index->find($query); foreach ($hits as $hit) $index->delete($hit->id); $index->commit(); }

public static function updateSingleGroupTags($boardID, $index) {

self::deleteSingleGroupTags($boardID, $index);

$tagString = groupsHandler::getGroupTagsAsString($boardID);
$group = groupsHandler::getSingleGroupByID($boardID);
$doc = new Zend_Search_Lucene_Document();

$doc->addField(Zend_Search_Lucene_Field::Keyword('boardID', $boardID));
$doc->addField(Zend_Search_Lucene_Field::Text('tags', $tagString, 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::Text('title', hackFunctions::hack_stringToLower(strip_tags($group['title'])), 'utf-8'));
$doc->addField(Zend_Search_Lucene_Field::Text('description', hackFunctions::hack_stringToLower(strip_tags($group['description'])), 'utf-8'));


Here is how it works: This error occures after a call to addDocument(). The problem is that private variable $_directory is NULL after return from deleteSingleGroupTags().

If I move all code form deleteSingleGroupTags() to deleteSingleGroupTags() variable $_directory is present and addDocument() works fine.

If i call deleteSingleGroupTags() and check for $_directory one line before return form funcion it is present, but it disappears just after return from function. So I'm not sure if this is ZEND or PHP issue. Variable $_directory dissapears only after $index->find() returns any hits. It doesn't matter if I try to delete those hits. It will always fail if I call find().

Tested on versions: ZF 1.5.0 PR ZF 1.5.0 ZF 1.5.3 ZF 1.6.2 ZF 1.7.1 PHP 2.5.2 Vista Home Premium: Windows NT 6.0 build 6001

Posted by Aleksander Wons (xelah) on 2009-01-14T00:57:42.000+0000

To above comment: PHP is 5.2.5 of course :)

Posted by Adam Lundrigan (adamlundrigan) on 2011-06-08T21:04:18.000+0000

Is this still an issue?

If so, how are you setting up your instance of Zend_Search_Lucene? The problem the original poster describes can occur when the $directory constructor argument passed to that class is not a string nor an instance of Zend_Search_Lucene_Storage_Directory_Filesystem.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.