Moodle
  1. Moodle
  2. MDL-21633

array to string conversion on keyswap

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: MNet
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      26575

      Description

      I guess this could be a datalib bug, but when what will be inserted into the database when the value is an array??

      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP Notice: Array to string conversion in /var/www/lib/datalib.php on line 31, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP Stack trace:, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP 1.

      {main}

      () /var/www/admin/mnet/peers.php:0, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP 2. include_once() /var/www/admin/mnet/peers.php:7, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP 3. mnet_environment->init() /var/www/mnet/lib.php:25, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP 4. mnet_environment->get_keypair() /var/www/mnet/environment.php:71, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP 5. mnet_environment->replace_keys() /var/www/mnet/environment.php:145, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP 6. addslashes_object() /var/www/mnet/environment.php:172, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] PHP 7. addslashes() /var/www/lib/datalib.php:31, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings
      [Tue Feb 16 11:19:02 2010] [error] [client 192.168.254.6] New public key has been generated. It expires 2010/03/16 11:19:02, referer: http://moodle.dev/admin/settings.php?section=frontpagesettings

        Activity

        Hide
        Dan Poltawski added a comment -

        Penny - just assigning to you to cast your eyes on it before you disappear away from mnet land..

        Show
        Dan Poltawski added a comment - Penny - just assigning to you to cast your eyes on it before you disappear away from mnet land..
        Hide
        Penny Leach added a comment -

        Can you put a print_object($this) before line 172 in mnet/environmnet.php ?

        Show
        Penny Leach added a comment - Can you put a print_object($this) before line 172 in mnet/environmnet.php ?
        Hide
        Dan Poltawski added a comment -

        keypair:

        mnet_environment Object
        (
        [id] => 14
        [wwwroot] => http://moodle.dev
        [ip_address] => 192.168.254.6
        [public_key] => ----BEGIN CERTIFICATE----
        MIIDzTCCAzagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBpjELMAkGA1UEBhMCR0Ix
        EjAQBgNVBAgTCUxhbmNhc3RlcjESMBAGA1UEBxMJTGFuY2FzdGVyMRQwEgYDVQQK
        EwtDTEVPIE1vb2RsZTEPMA0GA1UECxMGTW9vZGxlMRowGAYDVQQDExFodHRwOi8v
        bW9vZGxlLmRldjEsMCoGCSqGSIb3DQEJARYdZGFuLnBvbHRhd3NraUBsYW5jYXN0
        ZXIuYWMudWswHhcNMTAwMjE2MjAzOTA2WhcNMTAwMzE2MjAzOTA2WjCBpjELMAkG
        A1UEBhMCR0IxEjAQBgNVBAgTCUxhbmNhc3RlcjESMBAGA1UEBxMJTGFuY2FzdGVy
        MRQwEgYDVQQKEwtDTEVPIE1vb2RsZTEPMA0GA1UECxMGTW9vZGxlMRowGAYDVQQD
        ExFodHRwOi8vbW9vZGxlLmRldjEsMCoGCSqGSIb3DQEJARYdZGFuLnBvbHRhd3Nr
        aUBsYW5jYXN0ZXIuYWMudWswgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMSE
        1/raM4umHyBTIOU7TyXLzjXLF8dcudtj1kOgSjws4Uq3eqU0id18I3bQ6GvUUpgj
        SXJLGhfKApIIiIieJWFbByojFbG64S/kkfv6faEryWy94xe0QIJHn/QkFdjPEwdc
        /bsLMgi9hA5T39mMrweJrXOlxLJw9YT3pc4exw47AgMBAAGjggEHMIIBAzAdBgNV
        HQ4EFgQUEpfZTRCUAYEg48ppONF3uDioOdQwgdMGA1UdIwSByzCByIAUEpfZTRCU
        AYEg48ppONF3uDioOdShgaykgakwgaYxCzAJBgNVBAYTAkdCMRIwEAYDVQQIEwlM
        YW5jYXN0ZXIxEjAQBgNVBAcTCUxhbmNhc3RlcjEUMBIGA1UEChMLQ0xFTyBNb29k
        bGUxDzANBgNVBAsTBk1vb2RsZTEaMBgGA1UEAxMRaHR0cDovL21vb2RsZS5kZXYx
        LDAqBgkqhkiG9w0BCQEWHWRhbi5wb2x0YXdza2lAbGFuY2FzdGVyLmFjLnVrggEA
        MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAt/zdTu90JOJUnMJq+gYs
        21+XTB190FjMay+Up1bnzHiYPTZ69BS5XqalmVQnTR4YNAl951gLeq8X39d1x0E2
        j+vh7bxY59Z5FfFT4Euy6lVc686CHKUGJ0h0k2thwx1FX415J5IO1MXaMhbNk1s3
        leCVAR8x0O4L+bcegoFdVzw=
        ----END CERTIFICATE----

        [public_key_expires] => 1268771946
        [last_connect_time] => 0
        [last_log_id] => 0
        [keypair] => Array
        (
        [certificate] => ----BEGIN CERTIFICATE----
        MIIDzTCCAzagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBpjELMAkGA1UEBhMCR0Ix
        EjAQBgNVBAgTCUxhbmNhc3RlcjESMBAGA1UEBxMJTGFuY2FzdGVyMRQwEgYDVQQK
        EwtDTEVPIE1vb2RsZTEPMA0GA1UECxMGTW9vZGxlMRowGAYDVQQDExFodHRwOi8v
        bW9vZGxlLmRldjEsMCoGCSqGSIb3DQEJARYdZGFuLnBvbHRhd3NraUBsYW5jYXN0
        ZXIuYWMudWswHhcNMTAwMjE2MjAzOTA2WhcNMTAwMzE2MjAzOTA2WjCBpjELMAkG
        A1UEBhMCR0IxEjAQBgNVBAgTCUxhbmNhc3RlcjESMBAGA1UEBxMJTGFuY2FzdGVy
        MRQwEgYDVQQKEwtDTEVPIE1vb2RsZTEPMA0GA1UECxMGTW9vZGxlMRowGAYDVQQD
        ExFodHRwOi8vbW9vZGxlLmRldjEsMCoGCSqGSIb3DQEJARYdZGFuLnBvbHRhd3Nr
        aUBsYW5jYXN0ZXIuYWMudWswgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMSE
        1/raM4umHyBTIOU7TyXLzjXLF8dcudtj1kOgSjws4Uq3eqU0id18I3bQ6GvUUpgj
        SXJLGhfKApIIiIieJWFbByojFbG64S/kkfv6faEryWy94xe0QIJHn/QkFdjPEwdc
        /bsLMgi9hA5T39mMrweJrXOlxLJw9YT3pc4exw47AgMBAAGjggEHMIIBAzAdBgNV
        HQ4EFgQUEpfZTRCUAYEg48ppONF3uDioOdQwgdMGA1UdIwSByzCByIAUEpfZTRCU
        AYEg48ppONF3uDioOdShgaykgakwgaYxCzAJBgNVBAYTAkdCMRIwEAYDVQQIEwlM
        YW5jYXN0ZXIxEjAQBgNVBAcTCUxhbmNhc3RlcjEUMBIGA1UEChMLQ0xFTyBNb29k
        bGUxDzANBgNVBAsTBk1vb2RsZTEaMBgGA1UEAxMRaHR0cDovL21vb2RsZS5kZXYx
        LDAqBgkqhkiG9w0BCQEWHWRhbi5wb2x0YXdza2lAbGFuY2FzdGVyLmFjLnVrggEA
        MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAt/zdTu90JOJUnMJq+gYs
        21+XTB190FjMay+Up1bnzHiYPTZ69BS5XqalmVQnTR4YNAl951gLeq8X39d1x0E2
        j+vh7bxY59Z5FfFT4Euy6lVc686CHKUGJ0h0k2thwx1FX415J5IO1MXaMhbNk1s3
        leCVAR8x0O4L+bcegoFdVzw=
        ----END CERTIFICATE----

        [keypair_PEM] => ----BEGIN RSA PRIVATE KEY----
        MIICWwIBAAKBgQDEhNf62jOLph8gUyDlO08ly841yxfHXLnbY9ZDoEo8LOFKt3ql
        NIndfCN20Ohr1FKYI0lySxoXygKSCIiIniVhWwcqIxWxuuEv5JH7+n2hK8lsveMX
        tECCR5/0JBXYzxMHXP27CzIIvYQOU9/ZjK8Hia1zpcSycPWE96XOHscOOwIDAQAB
        AoGAfCE9G2KAdJE10AEyIhlYYRNe6XOjTXYwn3dse8LfoSroE33ZpkiNXK1w6TgD
        1ziCAz8mwV7W2HftL7jcJQ9fpAeY7NUL0RT9U1vMwj//oleqcwThvJnsd4Fqd0v2
        SAakCMe+MA753rgM52HCQhKSWWpYRIBbQiHd6g5PsL+Y1qECQQDmlV2iqRKloMmU
        gnYIU0seT7zU1FNFvQ9OQ+nTwiV6vtKyX80cyWRu9BWVvMKgVCWTQBuENr9AAtNO
        8aLxvLGnAkEA2i49gusvlvsJLBFqT3XkaqdPSwKjHQyH8GraaJV5tkLYGmiMgtEk
        06w/y3XCtuV7f7rmoqHMUqnxoG5RbFtJTQJAMkm/GxuOkorHi9kMDvLDfj/bqfsI
        kjwSW3paQ7Gi5Os7HmXgYPfXLI+VKYv6Umcnrr6bgbFC8p3rIdt3Mwt5HwJAf9F7
        I8mYlcD3vKNvPqH4cSsXXwBqgsgmk4hl78MyDL7YT5BUUQcppgBRV2bj7bY/RbM/
        DqPvSbZZ4fz/IpXQOQJAA4PEN9Np0x968IUKRfHmFkwaoXMJZKRmKRFYuKF7jpLr
        L7NZAK45jmU+3Chfws5xrompsQwMzgcqUbkhi2o9qg==
        ----END RSA PRIVATE KEY----

        )

        [deleted] => 0
        [name] =>
        [transport] => 0
        [portno] => 0
        [force_theme] => 0
        [theme] =>
        [applicationid] => 1
        )

        Show
        Dan Poltawski added a comment - keypair: mnet_environment Object ( [id] => 14 [wwwroot] => http://moodle.dev [ip_address] =>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0BCQEWHWRhbi5wb2x0YXdza2lAbGFuY2FzdGVyLmFjLnVrggEA MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAt/zdTu90JOJUnMJq+gYs 21+XTB190FjMay+Up1bnzHiYPTZ69BS5XqalmVQnTR4YNAl951gLeq8X39d1x0E2 j+vh7bxY59Z5FfFT4Euy6lVc686CHKUGJ0h0k2thwx1FX415J5IO1MXaMhbNk1s3 leCVAR8x0O4L+bcegoFdVzw= ---- END CERTIFICATE ---- [public_key_expires] => 1268771946 [last_connect_time] => 0 [last_log_id] => 0 [keypair] => Array ( [certificate] => ---- BEGIN CERTIFICATE ---- MIIDzTCCAzagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBpjELMAkGA1UEBhMCR0Ix EjAQBgNVBAgTCUxhbmNhc3RlcjESMBAGA1UEBxMJTGFuY2FzdGVyMRQwEgYDVQQK EwtDTEVPIE1vb2RsZTEPMA0GA1UECxMGTW9vZGxlMRowGAYDVQQDExFodHRwOi8v bW9vZGxlLmRldjEsMCoGCSqGSIb3DQEJARYdZGFuLnBvbHRhd3NraUBsYW5jYXN0 ZXIuYWMudWswHhcNMTAwMjE2MjAzOTA2WhcNMTAwMzE2MjAzOTA2WjCBpjELMAkG A1UEBhMCR0IxEjAQBgNVBAgTCUxhbmNhc3RlcjESMBAGA1UEBxMJTGFuY2FzdGVy MRQwEgYDVQQKEwtDTEVPIE1vb2RsZTEPMA0GA1UECxMGTW9vZGxlMRowGAYDVQQD ExFodHRwOi8vbW9vZGxlLmRldjEsMCoGCSqGSIb3DQEJARYdZGFuLnBvbHRhd3Nr aUBsYW5jYXN0ZXIuYWMudWswgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMSE 1/raM4umHyBTIOU7TyXLzjXLF8dcudtj1kOgSjws4Uq3eqU0id18I3bQ6GvUUpgj SXJLGhfKApIIiIieJWFbByojFbG64S/kkfv6faEryWy94xe0QIJHn/QkFdjPEwdc /bsLMgi9hA5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AAtNO 8aLxvLGnAkEA2i49gusvlvsJLBFqT3XkaqdPSwKjHQyH8GraaJV5tkLYGmiMgtEk 06w/y3XCtuV7f7rmoqHMUqnxoG5RbFtJTQJAMkm/GxuOkorHi9kMDvLDfj/bqfsI kjwSW3paQ7Gi5Os7HmXgYPfXLI+VKYv6Umcnrr6bgbFC8p3rIdt3Mwt5HwJAf9F7 I8mYlcD3vKNvPqH4cSsXXwBqgsgmk4hl78MyDL7YT5BUUQcppgBRV2bj7bY/RbM/ DqPvSbZZ4fz/IpXQOQJAA4PEN9Np0x968IUKRfHmFkwaoXMJZKRmKRFYuKF7jpLr L7NZAK45jmU+3Chfws5xrompsQwMzgcqUbkhi2o9qg== ---- END RSA PRIVATE KEY ---- ) [deleted] => 0 [name] => [transport] => 0 [portno] => 0 [force_theme] => 0 [theme] => [applicationid] => 1 )
        Hide
        Penny Leach added a comment -

        I guess it's the keypair array key, which contains an empty array. that table doesn't have that field on it.

        Is this your mnet localhost, or a remote peer?

        Show
        Penny Leach added a comment - I guess it's the keypair array key, which contains an empty array. that table doesn't have that field on it. Is this your mnet localhost, or a remote peer?
        Hide
        Dan Poltawski added a comment -

        localhost

        Show
        Dan Poltawski added a comment - localhost
        Hide
        Penny Leach added a comment -

        What if you do something like:

        $dbobj = clone($this);
        unset($dbobj->keypair);

        and then change the update_record line to use $dbobj

        Does that fix it ?

        Show
        Penny Leach added a comment - What if you do something like: $dbobj = clone($this); unset($dbobj->keypair); and then change the update_record line to use $dbobj Does that fix it ?
        Hide
        Penny Leach added a comment -

        fwiw, I think datalib shouldn't complain about things being arrays , if they're not fields on the table.

        Show
        Penny Leach added a comment - fwiw, I think datalib shouldn't complain about things being arrays , if they're not fields on the table.
        Hide
        Dan Poltawski added a comment -

        Oops, stole the wrong bug from you..

        Show
        Dan Poltawski added a comment - Oops, stole the wrong bug from you..
        Hide
        Penny Leach added a comment -

        I tested it , that proposed fix worked. Didn't need fixing in 2.0 so it's gone into stable.

        Show
        Penny Leach added a comment - I tested it , that proposed fix worked. Didn't need fixing in 2.0 so it's gone into stable.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: