midgardproject / midgard-php5

PHP5 API for Midgard persistent storage framework
http://www.midgard-project.org/api-docs/midgard/php/ratatoskr/
GNU Lesser General Public License v2.1
9 stars 2 forks source link

Undelete broken? #121

Open floegel opened 10 years ago

floegel commented 10 years ago

Hi, it seems like the undelete functionality is broken.

I tested the following code:

$topic = new midgard_topic();
$topic->name = uniqid("topic" . microtime());
$topic->create();
$stat = $topic->delete();
var_dump("delete", $stat, $topic->metadata->deleted);
// this should work
$stat = midgard_topic::undelete($topic->guid);
var_dump("undelete", $stat, $topic->metadata->deleted);
var_dump(midgard_connection::get_instance()->get_error_string());

I would expect the undelete to return true and the metadata_deleted property to be false afterwards. Unfortunately, i get this output instead:

string 'delete' (length=6)
boolean true
boolean true
string 'undelete' (length=8)
boolean false
boolean true
string 'Undefined errorProperty 'guid' doesn't seem to be registered for 'MidgardRepligard' class' (length=89)

Kind regards

piotras commented 10 years ago

Might be. A test for this case would be very helpful. https://github.com/midgardproject/midgard-core/tree/master/tests/GIR

floegel commented 10 years ago

Well, would it be helpful if i made a phpt test out of my code or do you think this is an issue with midgard-core? Furthermore, would you be willing to fix the issue if i came up with a respective unittest for midgard-core?

piotras commented 10 years ago

This is midgard-core issue I suspect. And yeah, having core test would help a lot with a fix.