Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

Activity

  • OnWeb replied on the discussion topic Getting disabled entity
    I don't have: access_show_hidden_entities(true); I think it could be elgg_get_entities_from_metadata, elgg_get_entities works fine but elgg_get_entities_from_metadata might be different. Can you test with... view reply
  • OnWeb replied on the discussion topic Getting disabled entity
    I thought by default elgg_get_entities_from_metadata or elgg_get_entities returns only enabled entities but it does not. That's why I found this thread and tried adding wheres but even with it does not work. I'm trying to get ONLY... view reply
  • OnWeb replied on the discussion topic Getting disabled entity
    How to make this work on elgg_get_entities_from_metadata? I actually need to get only enabled entities but it returns all of them, even disabled ones. here is code: $options = array( 'types' =>... view reply
  • Thing that makes me believe it is my foreach loops is because if I only use this: foreach ($data->parts as $core_title) { $attachment = $core_title->number; $obj->annotate('cores', $attachment); } it... view reply
  • @steve_clay Thank you for your help first of all. Reason SQL LIMIT is 1 is because there is only 1 entity with that exact title (655-2032B, 655-2056 or 300-85091) that are in original array and SQL query is inside foreach code. I tried setting... view reply
  • This might sound complicated because it is, to me anyway. Any suggestions are appreciated. I have array of strings (using var_dump): array(3) { [0]=> string(9) "655-2032B" [1]=> string(8) "655-2056" [2]=> string(9)...
    • @steve_clay

      Thank you for your help first of all.

      Reason SQL LIMIT is 1 is because there is only 1 entity with that exact title (655-2032B, 655-2056 or 300-85091) that are in original array and SQL query is inside foreach code. I tried setting it to 0 and still same result.

      Same with using  $escaped_q = sanitize_string($q); returns same result.

      I think I'm doing something wrong with "foreach", This is what I'm trying to do and I think I'm doing in the code but not quite it seems like.

      Original data comes from Json ( $data = json_decode($json); )

      Inside foreach ($data->parts as $core_title) {)  which are 655-2032B, 655-2056 and 300-85091 so using $q = $core_title->number; ) gets all 3 numbers (it should as I'm using foreach)

      Inside that I get entity for each of those numbers using SQL query and elgg_get_entities (those numbers correspond to entity title so it finds them)

      Then I get GUID for each of the entities inside that using

      foreach ($entity as $o) { $coreguid = $o->guid; $coreguides[] = $o->guid; }

      So I think I need another foreach maybe to get all 3 numbers in foreach ($data->parts as $core_title) { processed by elgg_get_entities that matches number to each entity title and pulls GUID of these found entities.

      Code only gets first one 655-2032B and pulls its GUID which is 23314

      That's why I'm looking at var dump results of the code:

      var_dump($attachment); returns  all 3 items:

      array(3) { [0]=> string(9) "655-2032B" [1]=> string(8) "655-2056" [2]=> string(9) "300-85091" }

         var_dump($coreguides); returns only 1, first one:

      array(1) { [0]=> int(23314) }

    • Thing that makes me believe it is my foreach loops is because if I only use this:

      foreach ($data->parts as $core_title) {
          $attachment = $core_title->number;  
      
          $obj->annotate('cores', $attachment);
          }

      it creates annotation with each number as value. (655-2032B, 655-2056 and 300-85091)

      But I need to find object that has title as each number first and then annotate with GUID of that object for each number.

    • Explain again, what you try to do?

      655-2032B, 655-2056 and 300-85091

      What is it: title or metadata?

      Do you want to search a part of title, or get the entities by value?

  • OnWeb replied on the discussion topic API or custom endpoint
    @ihayredinov Getting these errors: Call to undefined function elgg_get_signed_url() and elgg_signed_request_gatekerper() and validate_checksum() Because I'm on Elgg 1.8? Or I need to make those functions? Thanks. view reply
  • OnWeb replied on the discussion topic API or custom endpoint
    @rivervanrain Thanks for the help, unfortunately I am still on 1.8, I figured out the problem with that but I appreciate your help. @ihayredinov I see where you're going with this, my original thought was to create custom page... view reply