Project

General

Profile

Bug #6584

Repository data managers get_content_object_publication_attributes inconsistent signature.

Added by Anonymous over 6 years ago. Updated over 6 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
-
Start date:
19/08/2013
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal

Description

when clicking on a calendar in the repo browser: php fatal error:


Fatal error: Call to undefined method MDB2_Error::fetchRow() in /home/kmoerman/Code/chamilo-dev/application/wiki/php/lib/data_manager/mdb2.class.php on line 199

Call Stack:
    0.0002     673256   1. {main}() /home/kmoerman/Code/chamilo-dev/index.php:0
    0.2959   17404432   2. common\libraries\Application::launch() /home/kmoerman/Code/chamilo-dev/index.php:87
    0.3164   21764832   3. repository\RepositoryManagerViewerComponent->run() /home/kmoerman/Code/chamilo-dev/common/libraries/php/shared/application.class.php:777
    0.3556   29645216   4. repository\RepositoryManager->get_content_object_publication_attributes() /home/kmoerman/Code/chamilo-dev/repository/php/lib/repository_manager/component/viewer.class.php:131
    0.3556   29645536   5. repository\DataManager::get_content_object_publication_attributes() /home/kmoerman/Code/chamilo-dev/repository/php/lib/repository_manager/repository_manager.class.php:470
    0.3627   30793968   6. call_user_func() /home/kmoerman/Code/chamilo-dev/repository/php/lib/data_manager/data_manager.class.php:1123
    0.3632   30922200   7. application\wiki\WikiManager::get_content_object_publication_attributes() /home/kmoerman/Code/chamilo-dev/repository/php/lib/data_manager/data_manager.class.php:1123
    0.3644   31194752   8. application\wiki\Mdb2WikiDataManager->get_content_object_publication_attributes() /home/kmoerman/Code/chamilo-dev/application/wiki/php/lib/wiki_manager/wiki_manager.class.php:141

Strangely, the error comes from the wiki manager, whereas the object is an external calendar


Files

History

#1

Updated by Anonymous over 6 years ago

this happens for every object in the repository - i guess the type is wrongly deduced

#2

Updated by Anonymous over 6 years ago

  • Target version set to LCMS 4 Beta
#3

Updated by Anonymous over 6 years ago

  • Status changed from New to Bug resolved

resolved:

removed unnecessary $user parameter in call to DataManager :: get_content_object_publication_atributes in file repository/php/lib/repository_manager/repository_manager.class.php line 466

#4

Updated by Anonymous over 6 years ago

  • Status changed from Bug resolved to Needs testing

There is inconsistency in the parameters of all the get_content_object_publication_attributes functions. The signature assumed by the driver code is

class SomeSpecificApplicationManager {
  public static function get_content_object_publication_attributes ($attributes_type, $identifier, $condition, $count, $offset, $order_property)
}

This method is called from the general data manager repository/php/lib/data_manager/data_manager.class.php as

$application_attributes = call_user_func(
    array(
        Webapplication :: determine_namespace($application_name) . '\\' .
        WebApplication :: get_application_class_name(
            $application_name
        ), 'get_content_object_publication_attributes'
    ),
    $attributes_type,
    $identifier,
    $condition
);

The weblcms application has a correct signature, all objects from the weblcms cooperate nicely with the repository.

However the wiki data manager (for example), and most other applications are inconsistent with the above signature

public static function get_content_object_publication_attributes($object_id, $type, $offset, $count, $order_property)

#5

Updated by Anonymous over 6 years ago

  • Status changed from Needs testing to Needs more info

There is inconsistency in the parameters of all the get_content_object_publication_attributes functions. The most common signature seems to be:

public static function get_content_object_publication_attributes ($attributes_type, $identifier, $condition, $count, $offset, $order_property)

As an example: the wiki data manager is inconsistent with the above signature

public static function get_content_object_publication_attributes($object_id, $type, $offset, $count, $order_property)

This method is called from the general data manager repository/php/lib/data_manager/data_manager.class.php as

$application_attributes = call_user_func(
    array(
        Webapplication :: determine_namespace($application_name) . '\\' .
        WebApplication :: get_application_class_name(
            $application_name
        ), 'get_content_object_publication_attributes'
    ),
    $attributes_type,
    $identifier,
    $condition
);

#6

Updated by Anonymous over 6 years ago

  • Subject changed from external calendar: error when clicking in opn external calendar in repository browser to Repository data managers get_content_object_publication_attributes inconsistent signature.
#7

Updated by Anonymous over 6 years ago

resolved (needs testing / approval)

set same signature for get_content_object_publication_attributes throughout chamilo source code
changed user type checks from

if (isset($type)
    if ($type == 'user')
        // ...

to

if (isset($type) && $type == 'user')

to avoid empty queries (which produced a lot of fatal errors within the get_co_pub_attr methods)

#8

Updated by Anonymous over 6 years ago

  • Status changed from Needs more info to Bug resolved

Also available in: Atom PDF