News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

version check in package code

Started by dougiefresh, October 31, 2014, 06:33:10 PM

Previous topic - Next topic

dougiefresh

I'd like to make a bug report.  In Subs-Package.php, I keep seeing this error:
Quotehttp://my.site/index.php?action=admin;area=packages;sa=browse
Apply Filter: Only show the errors with the same message
8: Undefined offset: 1
Apply Filter: Only show the errors from this file
File: /home/xptspn5/public_html/site/board/Sources/Subs-Package.php
Line: 1506

That line is in this statement (line causing error is highlighted in red):
Quote$versions[$id] = array(
            'major' => (int) $parts[1],
            'minor' => !empty($parts[2]) ? (int) $parts[2] : 0,
            'patch' => !empty($parts[3]) ? (int) $parts[3] : 0,
            'type' => empty($parts[4]) ? 'stable' : $parts[4],
            'type_major' => !empty($parts[6]) ? (int) $parts[5] : 0,
            'type_minor' => !empty($parts[6]) ? (int) $parts[6] : 0,
            'dev' => !empty($parts[7]),
        );
I've changed my copy to read like this (change is highlighted in red):
Quote$versions[$id] = array(
            'major' => !empty($parts[1]) ? (int) $parts[1] : 0,
            'minor' => !empty($parts[2]) ? (int) $parts[2] : 0,
            'patch' => !empty($parts[3]) ? (int) $parts[3] : 0,
            'type' => empty($parts[4]) ? 'stable' : $parts[4],
            'type_major' => !empty($parts[6]) ? (int) $parts[5] : 0,
            'type_minor' => !empty($parts[6]) ? (int) $parts[6] : 0,
            'dev' => !empty($parts[7]),
        );
This gets rid of the error message that keeps popping up when I install mods on my forum when this mod is installed.

Hope this helps....

Arantor

Well, here's the thing... I don't call the version check routine in this mod, so if it's broken, it's not actually related to this mod, and I wouldn't be surprised if it fails on a fresh 2.0.9 with whatever mod can't actually set its version properly.

dougiefresh

Whoops! ....  I'm sorry.  I just looked inside the mod package and that line isn't in the mod....  Damn....  Can this bug report be split off from this thread and inserted into the bug reports area?  Thanks very much!

Kindred

I finally noticed this and split it...

However, I don't think this is actually a bug...   mods **MUST** set the major version that they support so there should never be a case where this is triggered.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

live627


Kindred

Yes, it was... But, the code noted is core code, not mod code
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

live627

Was just noting for future reference so readers won't be confused when reading this thread out of context.

Advertisement: