Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40438

Convert all uses of textlib and collatorlib to the new auto loaded classes

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: General
    • Labels:
    • Sprint:
      BACKEND Sprint 3

      Description

      Now that MDL-40299 has been integrated,

      we should convert all uses in core of textlib:: or collatorlib:: to core_text:: and core_collator::

      (and possibly add warnings to codechecker)?

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            matteo Matteo Scaramuccia added a comment -

            FYI, 2.6dev (Build: 20130704) is currently broken (at least in my Windows env):

            PHP Fatal error:  Class 'textlib' not found in moodle-master\blocks\navigation\block_navigation.php on line 271
            

            Renaming textlib:: with core_text:: doesn't work:

            PHP Fatal error:  Class 'core_text' not found in moodle-master\blocks\navigation\block_navigation.php on line 271
            

            I've been successful in running the new code by renaming both the cache folder and the muc/config.php.

            Looking at the differences, the fault was in the classmap array in core_component.php not being updated: forced update required after MDL-40299?

            Show
            matteo Matteo Scaramuccia added a comment - FYI, 2.6dev (Build: 20130704) is currently broken (at least in my Windows env): PHP Fatal error: Class 'textlib' not found in moodle-master\blocks\navigation\block_navigation.php on line 271 Renaming textlib:: with core_text:: doesn't work: PHP Fatal error: Class 'core_text' not found in moodle-master\blocks\navigation\block_navigation.php on line 271 I've been successful in running the new code by renaming both the cache folder and the muc/config.php . Looking at the differences, the fault was in the classmap array in core_component.php not being updated: forced update required after MDL-40299 ?
            Hide
            skodak Petr Skoda added a comment -

            Hi Matteo, the class loading should work fine unless you have some unsupported op code cache. After any upgrade or PHP change go to the admin/idnex.php in your browser to trigger class map cache rebuild.

            Show
            skodak Petr Skoda added a comment - Hi Matteo, the class loading should work fine unless you have some unsupported op code cache. After any upgrade or PHP change go to the admin/idnex.php in your browser to trigger class map cache rebuild.
            Hide
            matteo Matteo Scaramuccia added a comment -

            Hi Petr,
            I'm used to use xcache for my Linux machines (no errors on updating to the same weekly) while in my Windows dev env no accelerator at all (at this time): I'll try to hit admin/index.php just in case the error will re-appear (guessing never, maybe until new classes will be added to the autoloading mechanism and if the reported error will be replicable).

            Show
            matteo Matteo Scaramuccia added a comment - Hi Petr, I'm used to use xcache for my Linux machines (no errors on updating to the same weekly ) while in my Windows dev env no accelerator at all (at this time): I'll try to hit admin/index.php just in case the error will re-appear (guessing never, maybe until new classes will be added to the autoloading mechanism and if the reported error will be replicable).
            Hide
            skodak Petr Skoda added a comment -

            my plan is to submit patch for this later this week after most of the issues get integrated (this should prevent most of the collisions), the risk of regressions is close to 0...

            Show
            skodak Petr Skoda added a comment - my plan is to submit patch for this later this week after most of the issues get integrated (this should prevent most of the collisions), the risk of regressions is close to 0...
            Hide
            skodak Petr Skoda added a comment -

            Submitting for integration, it would be good if this got integrated this week because there is a high chance this collides with other patches...

            Show
            skodak Petr Skoda added a comment - Submitting for integration, it would be good if this got integrated this week because there is a high chance this collides with other patches...
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Thanks Petr - this has been integrated now

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks Petr - this has been integrated now
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Unit tests run during integration review and by CI server.

            Show
            samhemelryk Sam Hemelryk added a comment - Unit tests run during integration review and by CI server.
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Huzzah, your code made it into Moodle. Perhaps now things are ever so slightly better!

            "The ship can't take this much pressure. Sometimes it falls apart just sitting in the hangar."
            ~ Professor Farnsworth

            Show
            samhemelryk Sam Hemelryk added a comment - Huzzah, your code made it into Moodle. Perhaps now things are ever so slightly better! "The ship can't take this much pressure. Sometimes it falls apart just sitting in the hangar." ~ Professor Farnsworth
            Hide
            nebgor Aparup Banerjee added a comment -

            i just noticed this change via a
            "Notice: Array to string conversion in ...stable_master/moodle/lib/classes/collator.php on line 203" - instead of a debugger notice but i couldn't find any working way to sort of do this:

            /**
             * Legacy collatorlib.
             * @deprecated since 2.6, use core_collator:: instead.
             */
            class collatorlib extends core_collator {
                private function __construct() {
                    debugging('collatorlib has been deprecated and has been superseded by core_collator class instead.', DEBUG_DEVELOPER);
                    parent::construct();
                }
            }

            so just commenting here, now onto why i got the notice.

            Show
            nebgor Aparup Banerjee added a comment - i just noticed this change via a "Notice: Array to string conversion in ...stable_master/moodle/lib/classes/collator.php on line 203" - instead of a debugger notice but i couldn't find any working way to sort of do this: /** * Legacy collatorlib. * @deprecated since 2.6, use core_collator:: instead. */ class collatorlib extends core_collator { private function __construct() { debugging('collatorlib has been deprecated and has been superseded by core_collator class instead.', DEBUG_DEVELOPER); parent::construct(); } } so just commenting here, now onto why i got the notice.

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13

                  Agile