zoomniac

About me: trying-to-be elgg developer :)
Location:
Website: http://
Email: info@look4media.com

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • zoomniac replied on the discussion topic not able to edit metadata
    no luck. As soon as I remove the admin privileges from the user, it doesn´t edit. :( thanks anyway and enjoy the rest of your weekend. view reply
  • zoomniac replied on the discussion topic not able to edit metadata
    here are the two lines for updating: remove_metadata($certificate_guid, 'ref1');create_metadata($certificate_guid, 'ref1', $val1, 'text', $_SESSION['user']->guid, ACCESS_PUBLIC);   note: I tried the differents type of access...   view reply
  • zoomniac replied on the discussion topic not able to edit metadata
    Like I said before, thanks for your help and I apologize if my words did hurt your feelings. It wasn´t my intention.I found the problem after hours of testing and commenting the create_metadata function. It ended up being a access_id issue. I... view reply
  • zoomniac replied on the discussion topic not able to edit metadata
    I have tried that too. I did read the documentation, I did read the Elgg1710/mod/profile/actions/edit.php you mentioned. And I even thought! And guess what? it didn´t work. I know I´m doing something wrong but your method to help people... view reply
  • zoomniac replied on the discussion topic not able to edit metadata
    First of all, thanks for your quick answers. So I tried this first: remove_metadata($certificate_guid,'ref1',$certificate_spec->ref1); but is not deleting the data. view reply
  • zoomniac replied on the discussion topic not able to edit metadata
    sorry my ignorance, but how do I get metadata id? view reply
  • zoomniac added a new discussion topic not able to edit metadata in the group Elgg Technical Support
    Hi there, I´m having trouble trying to change the metadata of an object. I´m using the same code to create and edit the metadata. The metadata info comes from a form. And the first time the code adds the metadata correctly but next time...
    • try :-

      remove_metadata($certificate_guid, 'ref1');
      create_metadata($certificate_guid, 'ref1', $val1, 'text', $certificate_guid, ACCESS_PUBLIC);

       

    • no luck. As soon as I remove the admin privileges from the user, it doesn´t edit. :(

      thanks anyway and enjoy the rest of your weekend.

    • Depending on who is executing the code, and who has write access to the metadata, it may be that you need to use the permissions plugin hook to grant permission.

       

      Try this:

      in start.php

          // override permissions for the certificate_permission_overwrite context
          register_plugin_hook('permissions_check', 'all', 'certificate_permissions_check');   

          function certificate_permissions_check(){

               if(get_context() == "certificate_permission_overwrite"){

                    return true;

               }

               return NULL;

          }

       

      And where you are editing your metadata prepend and append the following:

      $context = get_context();

      set_context('certificate_permission_overwrite');

       

      // do you metadata stuff here

       

      set_context($context);

  • zoomniac joined the group Elgg Technical Support