Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1847 closed defect (fixed)

Not all Midgard error code constants defined

Reported by: jval Owned by: indeyets
Priority: major Milestone: 8.09.9 Ragnaroek
Component: Midgard PHP Version: 8.09 Ragnaroek
Keywords: Cc:

Description

Create a file:

#!/usr/bin/php
<?php echo MGD_ERR_NOT_EXISTS; ?>

And run it. See. It's not defined as it prints the string instead of number.

Another way to test the same:

#!/usr/bin/php
<?php

$result = defined('MGD_ERR_NOT_EXISTS');
if (is_bool($result)) {
    if ($result) echo "yes";
    else echo "no";
}
else echo gettype($result);

?>

That prints "no".

If this is not php5-midgard issue reassign to midgard-core.

Change History (5)

comment:1 Changed 7 years ago by indeyets

  • Resolution set to fixed
  • Status changed from new to closed

(In [26273]) add missing error-constants. fixes #1847

comment:2 Changed 7 years ago by jval

  • Summary changed from MGD_ERR_NOT_EXISTS (Midgard error code -5) constant is not defined to Not all Midgard error code constants defined

These Midgard error code constants were not defined before above commit:

MGD_ERR_NO_METADATA = -3
MGD_ERR_NOT_EXISTS = -5
MGD_ERR_OBJECT_NO_PARENT = -17
MGD_ERR_TREE_IS_CIRCULAR = -26
MGD_ERR_OBJECT_IS_LOCKED = -27

Ignore if some of them aren't implemented in Ragnaroek. I took these from Mjolnir's error code list.

comment:3 Changed 7 years ago by jval

  • Resolution fixed deleted
  • Status changed from closed to reopened

I don't see MGD_ERR_NO_METADATA in the above commit, so reopening.

comment:4 Changed 7 years ago by indeyets

  • Resolution set to fixed
  • Status changed from reopened to closed

MGD_ERR_NO_METADATA is not available in ragnaroek

comment:5 Changed 7 years ago by jval

Ok. Confirming as fully fixed.

Ran a test with *ragnaroek* error code list:

MGD_ERR_OK
MGD_ERR_ERROR
MGD_ERR_ACCESS_DENIED
MGD_ERR_SITEGROUP_VIOLATION
MGD_ERR_NOT_OBJECT
MGD_ERR_NOT_EXISTS
MGD_ERR_INVALID_PROPERTY
MGD_ERR_INVALID_NAME
MGD_ERR_DUPLICATE
MGD_ERR_HAS_DEPENDANTS
MGD_ERR_RANGE
MGD_ERR_NOT_CONNECTED
MGD_ERR_SG_NOTFOUND
MGD_ERR_INVALID_OBJECT
MGD_ERR_QUOTA
MGD_ERR_INTERNAL
MGD_ERR_OBJECT_NAME_EXISTS
MGD_ERR_OBJECT_NO_STORAGE
MGD_ERR_OBJECT_NO_PARENT
MGD_ERR_INVALID_PROPERTY_VALUE
MGD_ERR_USER_DATA
MGD_ERR_OBJECT_DELETED
MGD_ERR_OBJECT_PURGED
MGD_ERR_OBJECT_EXPORTED
MGD_ERR_OBJECT_IMPORTED
MGD_ERR_MISSED_DEPENDENCE
MGD_ERR_TREE_IS_CIRCULAR
MGD_ERR_OBJECT_IS_LOCKED

...and every one of them is now defined.

Note: See TracTickets for help on using tickets.