Reuven

About me: Amateur web developer - Professional volunteer :)

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • Reuven replied on the discussion topic Prevent deletion of an object
    We can put the owner and container in in metadata view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Thank you iionly. From your answer I understand Jerome's comment about the Garbage collection plugin. The prevent deletion hook can create orphans which may be deleted by the garbage collection. So, this approach is not... view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Thank you Jerome. making the objects owned/contained by the Site. The site is never removed. Yes, I also thought about this solution. It is simpler.  Keep in mind that maybe the Garbage collection plugin can still remove the... view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Very good. Thank you Nikolai view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Interesting approach. I'll try it. BTW I forgot to mention that I use Elgg 2.3.16. But it has similar hook. Thank you very much Nikolai. view reply
  • Reuven replied on the discussion topic Prevent deletion of an object
    Interesting approach. I'll try it. BTW I forgot to mention that I use Elgg 2.3.16. But it has similar hook. Thank you very much Nikolai. view reply
  • Reuven added a new discussion topic Prevent deletion of an object in the group Plugin Development
    As far as I know when an owner of an object is deleted the object is deleted as well. Same for the container of the object. However, we have a payment object that due to accounting requirements must not be deleted even if the payer or the container...
    • Or creating a user just for the purpose of transferring all content formerly owned by accounts to be deleted to. Maybe easier to handle it this way if the content is supposed to be accessible on site as some plugins might rather expect the owner being of type user and not site.

      As for the garbage collection: the plugin searches the database for orphaned data (I think maybe mostly metadata/metastrings). If these database entries have an owner_id pointing to an entity no longer existing it gets removed. That's a rather short explanation (that might even in parts be wrong as I've not looked into the code to see what exactly is done). Anyway, the hook might not help to prevent deletion because the garbage collection would rather use raw MySQL code instead of making use of Elgg API functions (that would call the hooks).

    • Thank you iionly.

      From your answer I understand Jerome's comment about the Garbage collection plugin. The prevent deletion hook can create orphans which may be deleted by the garbage collection. So, this approach is not recommended.

       Or creating a user just for the purpose of transferring all content formerly owned by accounts to be deleted to. Maybe easier to handle it this way if the content is supposed to be accessible on site as some plugins might rather expect the owner being of type user and not site.

      I do not understand this comment. Could you please explain it?

      Do you think that making the objects owned/contained by the Site is not advisable?

      Thank you very much.

       

    • We can put the owner and container in in metadata

  • Reuven replied on the discussion topic similar elgg_get_metastring_map() for subtypes
    Thank you Jeroen view reply
  • Reuven replied on the discussion topic similar elgg_get_metastring_map() for subtypes
    Thank you Jerome. PS: please try updating to Elgg 3.3 then you don't have to worry about subtype id's and metastring id's As one member responded lately to your suggestion "I'm afraid". I have many plugins... view reply
  • Reuven added a new discussion topic similar elgg_get_metastring_map() for subtypes in the group Plugin Development
    Elgg 2.3.16 I wonder if there are similar functions to elgg_get_metastring_id() and elgg_get_metastring_map(), but for subtypes. Thank you
    • Thank you Jerome.

      PS: please try updating to Elgg 3.3 then you don't have to worry about subtype id's and metastring id's

      As one member responded lately to your suggestion "I'm afraid". I have many plugins and many features. It will take me long time to update. I cannot do it right now, but I heard from you that Elgg 4 is coming soon. So, hopefully I'll go directly to Egg 4. 

      Is it possible to go from 2.3 to 4 ?

       

    • @reuven you will need to upgrade to 3.3 first (at least for Elgg) and then go to 4.x. This can be done on the same day, but you need to do both steps.

  • Reuven added a new discussion topic Google Cloud in the group General Discussion
    Our non-profit has a nice discount on Google Cloud ($300/month). I'd like to use it for Elgg 2.3.14. However, they have millions of options that I "cannot see the forest for the trees", especially for a non-professional...
  • Reuven replied on the discussion topic Change icon avatar size
    Thank you Jeroen This mischievous hook on Elgg 2.3 works well --> elgg_register_plugin_hook_handler('entity:icon:sizes', 'object', 'set_custom_icon_sizes')  :) view reply
  • Reuven added a new discussion topic Change icon avatar size in the group Plugin Development
    Elgg 2.3.14 I need to change the avatar size of an object but keep it square. I googled but did not find a solution. Any guidance will be appreciated. Thanks a lot  
  • Reuven replied on the discussion topic Configuring SMTP settings
    With the help of iionly I've developed a plugin that works well with Amazon ses, for elgg 2.3.14 All the relevant code is in start.php (below). Also, you need to install the appropriate Amazon AWS sdk. Hope it help... view reply
  • Reuven replied on the discussion topic Error when change PHP version from 5.6 to 7.4
    Works great. Thank you very much RvR. I wish I can do it myself some day... maybe next incarnation .... :) view reply
  • Reuven added a new discussion topic Error when change PHP version from 5.6 to 7.4 in the group Plugin Development
    Elgg 2.3.14 I changed the PHP version from 5.6 to and got the following error: Fatal error: Declaration of hypeJunction\Interactions\Comment::save() must be compatible with ElggComment::save($update_last_action = true) in...
    • Change on:

      public function save($update_last_action = null) {
           $result = false;
           $update_last_action = true;
           if (elgg_trigger_before_event('create', 'object', $this)) {
                 $result = parent::save();
                 if ($result && $update_last_action) {
                     elgg_trigger_after_event('create', 'object', $this);
                 }
             }
      
            return $result;
      }
    • Works great.

      Thank you very much RvR.

      I wish I can do it myself some day... maybe next incarnation .... :)

  • Reuven replied on the discussion topic Database query
    Very useful Thank you very much for your help view reply
  • Reuven replied on the discussion topic Database query
    of course, the sum_of_metadata_a and the sum_of_metadata_b are for the Parent_guid of the record :) view reply
  • Reuven added a new discussion topic Database query in the group Plugin Development
    Elgg 2.3.14 I have two objects: Parent with subtype_parent and Child with subtype_child. In Child: container_guid = Parent_guid. Child has also two metadata 1) metadata_a and 2) metadata_b. Both are populated with integer. I would like...
  • Reuven replied on the discussion topic Get entities (type object) by title
    This works fine. Only the $entities[0]->delete should be $entities[0]->delete(). Thank you very much, we really appreciate your help. view reply