#StackBounty: #7 #blocks How to show Users facebook page feed on their profile page?

Bounty: 50

In my website users can specify their Facebook page id in their profile. Then when we view the users profile page it should show posts from the mentioned page as a block.

I have developed this feature using facebook graph api and requested ‘Page Public Content Access’ permission for my app. I requested this permission because I need to fetch feed from the pages which I do not have admin access.

But Facebook app review team have rejected my app permission request by saying that this permission is inappropriate for the use.

Can anyone please help me how can I get this requirement done in proper way and get my app approved by Facebook.


Get this bounty!!!

#StackBounty: #7 #commerce Commerce Fee not being added to order total sent to payment processor

Bounty: 500

I have followed the Commerce Fees module’s instructions found at https://www.drupal.org/project/commerce_fees:

DOCUMENTATION

    Go to admin/commerce/config/fees and add a new fee type
    Add a rule at admin/config/workflow/rules
        Event: "Apply a fee to a given order".
        Set the conditions.
        Action: "Apply a fee to an order".
            Entity data selector: "commerce-order".
            Fee: Your fee type.
            Set amounts, currency and taxes as necessary.

Notice: if using fees based on payment type, be sure to move the payment type pane to a screen before the review pane on admin/commerce/config/checkout so that customers can see the fee before accepting.

The Fee shows up in the cart contents on checkout but that fee is not added to the order total that is sent to the payment processor not show in the orders view. It’s like the fee is not actually added to the total, except for in the cart content view on the checkout page.

Any idea of what I am missing?


Get this bounty!!!

#StackBounty: #7 #theming #nodes Issue with Access PHP array in display module

Bounty: 50

I am passing few parameters via ajax to custom module (fgs_api.module) and in returns getting JSON data ($results->data). I want to use/get that variable ($results->data) in node--xyz.tpl.php content template. How can I use that variable in node--xyz.tpl.php. I am doing in drupal 7.

In module fgs_api.module

function fgs_api_data_execute($parameter1, $parameter2)
{   
    if(!is_null($parameter1) && !is_null($parameter2))
    {
        // my custom code which is working
         $results = $api->{'getSpecialOfferHomes'}(intval($parameter1), intval($parameter2)); 

        if($results->success)
        {
            $return = fgs_api_format_return(false, $results->data);
        }else{
            $return = fgs_api_format_return(true, $results->message);
        }
    }else{
        $return = fgs_api_format_return(true, 'Incorrect parameters');
    }
    return $return;
}

In Js

  var url = '/fgs_api_data_execute/' + parameter1 + '/' + parameter2;    
                console.log(url);

                $.ajax({
                    url: url,
                    type: 'POST',
                    dataType: 'json',
                    success: function (result) {   
                        if (result.data) {
                             console.log(result['data']);  // use this data in Module           
                        }else {
                           console.log("error");
                        }
                    },

How can I use/pass return data variable from custom module to node--xyz.tpl.php?


Get this bounty!!!

#StackBounty: #7 #forms #datetime How to limit form submission per user per day and week?

Bounty: 50

The goal is very straightforward. I need a form to limit each user to 1 submission per day and 3 per week.

What I found:

Webform:
The “Form settings” in webform has the “Per user submission limit” setting. It does not allow me to make more than 1 validation. I’m not able to have both per day and per week in the same form.

Entityform:
I found people use hook function on node limit on Drupal 8. This may work on Drupal 7 Entityform but I don’t know how to write that syntax.

Rule:
It may possible to use Rule module but I don’t see any connection with period of time validation.


Get this bounty!!!

#StackBounty: #7 #views #tokens How to set an exposed filter to enable current user to view nodes that he has not commented

Bounty: 50

On my D7 site I am trying to create an exposed filter where current users would choose whether he wants to see all nodes, or only those that current users have not commented. Tried adding ‘Comment: Comments of the node’ and ‘Comment: Author’ relationships, ‘Comment: Author uid’ contextual filter. I didn’t want to set a default value because I want users to switch between all nodes and ones commented by current user. Then I added a filter criteria ‘Comment: Author uid’ with setting up grouped filter using [current-user:uid] token. No success yet.


Get this bounty!!!

#StackBounty: #7 #taxonomy-terms #rules #webforms How do I create the "Set a data value" from term reference?

Bounty: 50

I’m using Webform, webform rules, webform references, and conditional rules to generate node from webform submission. I’m able to generate a new node with fields except the Term Reference field with multiple checkboxs(the term reference in webform will use on the term reference in node). When I set a data value with “Term Reference”, it show a list of term in value (and no [data:{component}-value] option in data selectors).


Get this bounty!!!

#StackBounty: #7 #entities #tokens After saving entity bundle, entity_get_info('node') missing 'token type' property

Bounty: 50

After saving any entity bundle, e.g. node type on admin/structure/types/manage/node-type page, node ‘token type’ is gone:

$info = entity_get_info('node');
// isset($info['token type'])) == FALSE

After I change common.inc to regenerate entity info like this

if (FALSE && $cache = cache_get("entity_info:$langcode")) {
  $entity_info = $cache->data;
}

it started to work as expected.

Only ‘node’ entity type is affected.

In order to fix this I had to patch entity_get_info:

   $entity_info = &$drupal_static_fast['entity_info'];

+  if (!empty($entity_info) && !isset($entity_info['node']['token type'])) {
+    $entity_info = NULL;
+  }
+
   // hook_entity_info() includes translated strings, so each language is cached
   // separately.
   $langcode = $language->language;
@@ -7857,7 +7861,7 @@ function entity_get_info($entity_type = NULL) {
     if ($cache = cache_get("entity_info:$langcode")) {
       $entity_info = $cache->data;
     }
-    else {
+    if (empty($entity_info) || !isset($entity_info['node']['token type'])) {
       $entity_info = module_invoke_all('entity_info');

What can be the root cause of this issue and how can it be fixed?

I searched for an answer and found several similar questions on Drupal.org, but the only recommended thing is to clear cache several times (which does not even help in my case).


Get this bounty!!!

#StackBounty: #7 #entities #tokens After saving entity bundle, entity_get_info('node') missing 'token type' property

Bounty: 50

After saving any entity bundle, e.g. node type on admin/structure/types/manage/node-type page, node ‘token type’ is gone:

$info = entity_get_info('node');
// isset($info['token type'])) == FALSE

After I change common.inc to regenerate entity info like this

if (FALSE && $cache = cache_get("entity_info:$langcode")) {
  $entity_info = $cache->data;
}

it started to work as expected.

Only ‘node’ entity type is affected.

In order to fix this I had to patch entity_get_info:

   $entity_info = &$drupal_static_fast['entity_info'];

+  if (!empty($entity_info) && !isset($entity_info['node']['token type'])) {
+    $entity_info = NULL;
+  }
+
   // hook_entity_info() includes translated strings, so each language is cached
   // separately.
   $langcode = $language->language;
@@ -7857,7 +7861,7 @@ function entity_get_info($entity_type = NULL) {
     if ($cache = cache_get("entity_info:$langcode")) {
       $entity_info = $cache->data;
     }
-    else {
+    if (empty($entity_info) || !isset($entity_info['node']['token type'])) {
       $entity_info = module_invoke_all('entity_info');

What can be the root cause of this issue and how can it be fixed?

I searched for an answer and found several similar questions on Drupal.org, but the only recommended thing is to clear cache several times (which does not even help in my case).


Get this bounty!!!

#StackBounty: #7 #entities #tokens After saving entity bundle, entity_get_info('node') missing 'token type' property

Bounty: 50

After saving any entity bundle, e.g. node type on admin/structure/types/manage/node-type page, node ‘token type’ is gone:

$info = entity_get_info('node');
// isset($info['token type'])) == FALSE

After I change common.inc to regenerate entity info like this

if (FALSE && $cache = cache_get("entity_info:$langcode")) {
  $entity_info = $cache->data;
}

it started to work as expected.

Only ‘node’ entity type is affected.

In order to fix this I had to patch entity_get_info:

   $entity_info = &$drupal_static_fast['entity_info'];

+  if (!empty($entity_info) && !isset($entity_info['node']['token type'])) {
+    $entity_info = NULL;
+  }
+
   // hook_entity_info() includes translated strings, so each language is cached
   // separately.
   $langcode = $language->language;
@@ -7857,7 +7861,7 @@ function entity_get_info($entity_type = NULL) {
     if ($cache = cache_get("entity_info:$langcode")) {
       $entity_info = $cache->data;
     }
-    else {
+    if (empty($entity_info) || !isset($entity_info['node']['token type'])) {
       $entity_info = module_invoke_all('entity_info');

What can be the root cause of this issue and how can it be fixed?

I searched for an answer and found several similar questions on Drupal.org, but the only recommended thing is to clear cache several times (which does not even help in my case).


Get this bounty!!!