Chris She

Send private message

You must be logged in to send a private message.

Group membership

Activity

  • Seems like there is no such check. A fix for that could definitely save a lot of debugging time since the log entries in this case weren't really helpful. I will just leave an exception log here, which might also be of interest for that fix... view reply
  • Hey Steve, thanks for your tip which led me to the solution. The exception I got after following your advice was: PHP Fatal error:  Class 'DOMDocument' not found in /var/www/html/vendor/elgg/elgg/engine/classes/ElggAutoP.php on... view reply
  • Hey Guys, I am currently trying to install Elgg 2.0.4 on an Ubuntu 16.04 machine with an Apache2 server, PHP 5.6 and MySQL 5.6. I got everything running except Elgg. When I first navigated to the URL of my Elgg installation, I got a blank page...
    • Hey Steve, thanks for your tip which led me to the solution.

      The exception I got after following your advice was:

      PHP Fatal error:  Class 'DOMDocument' not found in /var/www/html/vendor/elgg/elgg/engine/classes/ElggAutoP.php on line 89

      So I checked my setup and installed the missing php5.6-xml package, but the Error would still show up. I then compared the PHP packages of my new machine with the packages of the old functioning installation and noticed that the 'gd' and 'mcrypt' packages were not installed on my new machine. Maybe something got messed up because I had to add the apt-repository for PHP 5.6 manually.

      Installing the missing packages fixed the error and I can now use the installer.

    • So the installer didn't check for those requirements? We need to fix that.

    • Seems like there is no such check. A fix for that could definitely save a lot of debugging time since the log entries in this case weren't really helpful.

      I will just leave an exception log here, which might also be of interest for that fix and first made me spend quite some time trying to fix a database problem that wasn't actually there:

      Exception #1472728435: exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'elgg.datalists' doesn't exist' in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:104\nStack trace:\n#0 /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(104): PDO->query('SELECT value FR...')\n#1 /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(935): Doctrine\\DBAL\\Driver\\PDOConnection->query('SELECT value FR...')\n#2 /var/www/html/vendor/elgg/elgg/engine/classes/Elgg/Database.php(589): Doctrine\\DBAL\\Connection->query('SELECT value FR...')\n#3 /var/www/html/vendor/elgg/elgg/engine/lib/elgglib.php(1907): Elgg\\Database->assertInstalled()\n#4 [internal function]: _elgg_engine_boot('boot', 'system', NULL)\n#5 /var/www/html/vendor/elgg/elgg/engine/classes/Elgg/EventsService.php(66): call_user_func_array('_elgg_engine_bo...', Array)\n#6 /var/www/html/vendor/elgg/elgg/engine/classes/Elgg/Application.php(252): Elgg\\EventsService->trigger('boot', 'system')\n#7 /var/www/html/vendor/elgg/elgg/engine/classes/Elgg/Application.php(402): Elgg\\Application->bootCore()\n#8 /var/www/html/vendor/elgg/elgg/engine/classes/Elgg/Application.php(360): Elgg\\Application->run()

      Exception #1472728435 : fatal error in exception handler : An exception occurred while executing 'SELECT value FROM config\n\t\t\tWHERE name = 'cookies' AND site_guid = 0':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'elgg.config' doesn't exist\n\n QUERY: SELECT value FROM config\n\t\t\tWHERE name = 'cookies' AND site_guid = 0

      This occurred while calling the Elgg site URL with an empty database named 'elgg' and a settings.php file with filled in DB connection data in the elgg-config directory and before installing the missing PHP packages from above.

  • Chris She replied on the discussion topic Getting entities in web services content
    Yes I already thought about occurring problems when logging in the user like this. And I think there was something like the current logged_in_user_guid being set to 0 when using logout() for some time even if another user is still logged in, but I... view reply
  • Chris She replied on the discussion topic Getting entities in web services content
    Thank you, that was the tip I needed. Because I use a standard user for all remote posts, I did not have to use API authentication. Instead I used login($user) before accessing an entity. This might probably be not the best / cleanest solution, but... view reply
  • Chris She added a new discussion topic Getting entities in web services content in the group Plugin Development
    Hey Guys, I built a custom Web Services API with functions registered via elgg_ws_expose_function() for posting messages to the social network. I know that there are plugins like hypeGraph that can do this in combination with hypeWall, but...
    • Probably the easiest solution with the current implementation. I don't think there is currently a method to authenticate a user with a token (without a password).

      Don't forget to kill session (logout()) after you finish, just to be sure :)

       

    • You may not want to deal with the user events (and logging false logins) on every request:

      login($user) --> elgg_get_session()->setLoggedInUser($user)

      logout() --> elgg_get_session()->removeLoggedInUser()

    • Yes I already thought about occurring problems when logging in the user like this. And I think there was something like the current logged_in_user_guid being set to 0 when using logout() for some time even if another user is still logged in, but I can't remember more details on this. Then I saw that login($user) does not log in the user persistantly - which would need the second parameter - so I more or less hoped that this would also work without calling logout() afterwards.

      In the next days I will definitely try out what Steve suggested, which seems to be a cleaner solution.

      login($user) --> elgg_get_session()->setLoggedInUser($user)

      logout() --> elgg_get_session()->removeLoggedInUser()

      It sounds to me as if it would have less impact on event triggering and maybe also on things like elgg_get_logged_in_user_guid(). Could you maybe give me a little more information about the differences between the two calls?

  • Oh man, I knew it would be something obvious. Don't know how I could miss this function. That's exactly what I was looking for. Thanks a lot view reply