jbostoen / itop-jb-mail-to-ticket-automation-v2

Originally a fork of Combodo's Mail to Ticket Automation, enriched with some new features. Also contains some bug fixes.
https://jeffreybostoen.be
6 stars 3 forks source link

Duplicate function in message helper #33

Closed poojaajudia closed 1 year ago

poojaajudia commented 1 year ago

GetMessageId is being duplicated in the class. Also, missing namespace mapping in autoloader.

jbostoen commented 1 year ago

Hi @poojaajudia , can you be more specific please?

poojaajudia commented 1 year ago

PHP error: for duplicate function GetMessageId in MessageHelper class.

The second function should be GetMessageSentTime instead. We have a reference of this function in other class while it doesn't exist in MessageHelper.

Also, a zip folder in latest release can't find MessageHelper class, again php error. The reason is vendor folder doesn't include MessageHelper namespace. I can fix this by running composer dump-autoload after extracting code from zip, but still it's good to correct dependency.

namespace Combodo\iTop\Extension\Helper;

class MessageHelper {

    /**
     * Returns Message-ID of an e-mail.
     *
     * @param \Object $oMessage Laminas e-mail object
     *
     * @return \String
     */
    public static function GetMessageId($oMessage) {

        return $oMessage->getHeader('Message-ID', 'string');

    }

    /**
     * Returns Message-ID of an e-mail.
     *
     * @param \Object $oMessage Laminas e-mail object
     *
     * @return \Integer UNIX timestamp
     */
    public static function GetMessageId($oMessage) {
        ...
poojaajudia commented 1 year ago

Thanks @jbostoen for a quick fix.