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

chatd.php uses a deprecated native php function socket_setopt wich was renamed to socket_set_option

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.13, 2.1.1, 2.2.5, 2.3.2, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Chat
    • Labels:
    • Environment:
      linux, mysql
    • Database:
      Any
    • Testing Instructions:
      Hide

      Try to start the chat daemon server with the following commands:
      cd moodle/mod/chat
      php chatd.php --start &
      If sucessful :
      Login as admin, choose module>activities>chat and choose chat daemon as chat method

      Show
      Try to start the chat daemon server with the following commands: cd moodle/mod/chat php chatd.php --start & If sucessful : Login as admin, choose module>activities>chat and choose chat daemon as chat method
    • Workaround:
      Hide

      Renaming the function from socket_setopt to socket_set_option solves this problem in mod/chat/chatd.php file.

      Show
      Renaming the function from socket_setopt to socket_set_option solves this problem in mod/chat/chatd.php file.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-29463-master

      Description

      If you want to use chat daemon method for the chat module you must start the server with the following commands:
      cd moodle/mod/chat
      php chatd.php --start &
      But chatd.php uses a deprecated native php function socket_setopt wich was renamed to socket_set_option, so the server does not start.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            salvetore Michael de Raadt added a comment -

            Thanks for reporting that and suggesting a solution.

            Show
            salvetore Michael de Raadt added a comment - Thanks for reporting that and suggesting a solution.
            Hide
            amrigo Angelo Rigo added a comment -

            Thank you i am glad to help!

            Show
            amrigo Angelo Rigo added a comment - Thank you i am glad to help!
            Hide
            dmonllao David Monllaó added a comment -

            Hi Jason,

            The changes looks good, but the MDL-27398 error is thrown when trying to execute chatd.php. I've attached a patch there to solve the problem (only this chatd problem) To test your patch could be useful to have the MDL-27398 patch integrated, so the MDL-27398 error will not be thrown.

            Show
            dmonllao David Monllaó added a comment - Hi Jason, The changes looks good, but the MDL-27398 error is thrown when trying to execute chatd.php. I've attached a patch there to solve the problem (only this chatd problem) To test your patch could be useful to have the MDL-27398 patch integrated, so the MDL-27398 error will not be thrown.
            Hide
            phalacee Jason Fowler added a comment -

            okay, I will link this one to your one so it goes in after - thanks David

            Show
            phalacee Jason Fowler added a comment - okay, I will link this one to your one so it goes in after - thanks David
            Hide
            nebgor Aparup Banerjee added a comment - - edited

            ok will wait for MDL-27398 here, thanks for the heads up!

            Show
            nebgor Aparup Banerjee added a comment - - edited ok will wait for MDL-27398 here, thanks for the heads up!
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

            TIA and ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
            Hide
            phalacee Jason Fowler added a comment -

            rebased

            Show
            phalacee Jason Fowler added a comment - rebased
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            (sending this back coz MDL-27398 continues not integrated, so this needs to wait for it to land)

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - (sending this back coz MDL-27398 continues not integrated, so this needs to wait for it to land)
            Hide
            cibot CiBoT added a comment -

            Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.

            Show
            cibot CiBoT added a comment - Moving this reopened issue out from current integration. Please, re-submit it for integration once ready.
            Hide
            phalacee Jason Fowler added a comment -

            rebased again

            Show
            phalacee Jason Fowler added a comment - rebased again
            Hide
            nebgor Aparup Banerjee added a comment -

            Hi Jason,
            can you verify whether this needs backporting to stable branches? it looks like it does to me.

            Show
            nebgor Aparup Banerjee added a comment - Hi Jason, can you verify whether this needs backporting to stable branches? it looks like it does to me.
            Hide
            phalacee Jason Fowler added a comment -

            yes, it should be backported, and should be a simple cherry pick from this patch

            Show
            phalacee Jason Fowler added a comment - yes, it should be backported, and should be a simple cherry pick from this patch
            Hide
            nebgor Aparup Banerjee added a comment -

            Thanks, those have been integrated into 22, 23 and master now.

            Please test for any further remaining issues for this chat daemon.

            ps: i did wonder about whether we could build in some phpunit tests here but it might be stretching is for now, i'm not sure, we certainly have better phpunit tests to consider implementing atm.

            Show
            nebgor Aparup Banerjee added a comment - Thanks, those have been integrated into 22, 23 and master now. Please test for any further remaining issues for this chat daemon. ps: i did wonder about whether we could build in some phpunit tests here but it might be stretching is for now, i'm not sure, we certainly have better phpunit tests to consider implementing atm.
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Works as expeceted
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Works as expeceted Thanks
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Gutta cavat lapidem, non vi sed saepe cadendo - Ovidio

            This issue has been integrated upstream and is now available both via git and cvs (and in some hours, via mirrors and downloads).

            Thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Gutta cavat lapidem, non vi sed saepe cadendo - Ovidio This issue has been integrated upstream and is now available both via git and cvs (and in some hours, via mirrors and downloads). Thanks!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Nov/12