texts: Form displays without  after page renders

texts:
everyone!

I'm trying to embed custom form (only file upload item, will attach the code below). But I see only inner stuff like divs and inputs. No form tag at all.

In page callback I use function that calls theme. here's hook_menu() and page callback

    $items['invite/%'] = array(
      'page callback' => 'invite_page_content',
      'page arguments' => array(1),
      'access callback' => 'invite_check_access',
      'access arguments' => array(1),
    );

    $output = array(
      '#theme' => 'invite_view',
      '#type' => 'markup',
      '#content' => array(
        'g_id' => $g_id,
        'g_name' => $g_name,
        'user' => $user,
      ),
    );

    return $output;

In theme file I have call of the form

    $attachment_form = drupal_get_form('invite_attachment_form');
    echo render($attachment_form);

Here's form function

    function invite_attachment_form($form, &$form_state) {
      $form['attachment'] = array(
        '#type' => 'managed_file',
        '#name' => 'upload_attachment',
        '#title' => t('Attach additional file?'),
        '#upload_location' => 'public://email-attachments/',
        '#upload_validators' => array(
          'file_validate_size' => array(2 * 1048576),
          'file_validate_extensions' => array(
            'png gif jpg jpeg mp4 ogg avi mov wmv flv ogv webm txt pdf zip rar',
          ),
        ),
      );

      return $form;
    }

Any help appreciated!

UPDATE

I've found what was the reason for such behavior. There is some script in my site that deletes first form element. So if I add  before my form render - everything will be ok. Need to find what is it.


texts: Views is ignoring my field .tpl.php file when the field is used as a replacement pattern in a rewritten field

texts:
I've been trying to modify a multiple-values field in a view. I thought I'd found the answer, creating a custom .tpl.php file using the naming structures detailed in Views UI's "Theme information" popup.

However, it seems that these tpl.php files are only respected when the field is output immediately, and not when it's set to be excluded from the display and then rewritten into another field using a replacement pattern. Views is seeing the file, and uses it if I don't have "exclude" ticked, but if I use a re-write pattern for the field, Views completely ignores the tpl.php file.

This happens regardless of whether "Use field template" is ticked for this field in Views UI's field Style Settings.

I almost always aggregate my fields like this to control the HTML output. How can I make Views respect my tpl.php file when re-writing the field content into another field?


texts: How to add links to sidebar without using a block?

texts: does anyone know how to add links or HTML onto the left sidebar of a drupal theme without using a block? I am using drupal 7.14. Any help would be appreciated.


texts: Load CSS and JS using absolute paths on select pages

texts:
I've got a page (menu callback) which serves as a template for an external service. As the HTML of the page is consumed by the external service and rewritten then served from their server, all the CSS and JS paths must be absolute. Elsewhere on my site I use relative paths via AdvAgg, but here I need to rewrite all the link elements to be of the type file, rather than type external.

How can I do this? I have tried doing a hook_css_alter or hook_js_alter and changing type to external and prefixing the data value with my site's base URL but it doesn't seem to be making my AdvAgg aggregate files absolute, their paths stay relative.

Another idea I had was iterating through all the site's CSS files and unsetting the local entries and instead calling drupal_add_js or drupal_add_css but referencing the files as external with an absolute path, but I don't know where I would do this.

I'm using Drupal 7 with CSS and JS aggregation turned on and with the AdvAgg module enabled.


texts: How can I set value to hidden field (Form Api) and send them with post method?

texts:
I’ve created a form with Form Api in a custom module.

I send datas with post method to a web service.

In buildForm()

$form['mode'] = array(
    '#type' => 'hidden',
    '#value' => 'INTERACTIVE',
);

$form['amount'] = array(
    '#type' => 'textfield'
);

$form['signature'] = array(
    '#type' => 'hidden',
     // here is the field I need to set its value on submit because its value depends on other field.
    '#value' => ''
 );

$form['#action'] = 'https://url-webservices.fr/‘

It works. But I need to set value to hidden fields 'signature' on submit.

How can I set value to hidden field and send them with form with post method ?

Something like this but it doesn't work :

in submitForm()

form_state->setValue('signature', $signature);

I’ve studied some examples and I can do that :

In validateForm()

$signature = 'string-to-send';
$form_state->setValue('signature', $signature);
$form_state->setRebuild();

And in buildForm() :

$signature = $form_state->getValue('signature');

$form['signature'] = array(
    '#type' => 'hidden',
    '#value' => $signature
);

Of course, it works only when page is reloaded when the form is rebuilt. If datas is send to an external URL with POST method, the field value is empty.


texts: jQuery dependency on a custom theme is not adding jQuery?

texts:
I know that this question has been asked previously many times but any of the solutions are not working in my case so please, I request if anyone can help me with this situation please provide me assistance.
I have added dependency of the core jQuery(along with other core libraries) in my theme.libraries.yml but only core jQuery is not loading in my drupal frontend and the console is showing the error of jQuery is not defined.
Also other drupal core libraries as working fine only jQuery is not loading.
My code of various files is as follows
theme.libraries.yml
global-styling:
  version: 1.x
  css:
    theme:
      css/bootstrap.css: {}
      css/custom.css: {}
      css/owl.carousel.min.css: {}
      css/owl.theme.default.min.css: {}
      css/responsive.css: {}
      css/style.css: {}
      fonts/fonts.css: {}
  js:
    js/bootstrap.js: {}
    js/owl.carousel.min.js: {}
    js/popper.js: {}
    js/scripts.js: {}
  dependencies:
    - core/jquery
    - core/jquery.once
    - core/drupal

theme.info.yml
name: wcsb
type: theme
description: 'Another outstanding WebCube Theme'
package: Core
version: '0.1.2'
core: '8.x'
base theme: classy

libraries:
  - wcsb/global-styling

regions:
  header_bar_1: 'Header Bar 1'
  header_bar_2: 'Header Bar 2'
  header_bar_3: 'Header Bar 3'
  header_bar_4: 'Header Bar 4'
  mobile_header_1: 'Mobile Header 1'
  mobile_header_2: 'Mobile Header 2'
  slider_images: 'Slider Images'
  breadcrumb: Breadcrumb
  featured_top: 'Featured top'
  above_content: 'Above Content'
  content: Content
  below_content: 'Below Content'
  sidebar_first: 'Sidebar first'
  sidebar_second: 'Sidebar second'
  featured_bottom_first: 'Featured bottom first'
  featured_bottom_second: 'Featured bottom second'
  featured_bottom_third: 'Featured bottom third'
  footer_first: 'Footer first'
  footer_second: 'Footer second'
  footer_third: 'Footer third'
  footer_fourth: 'Footer fourth'
  footer_fifth: 'Footer fifth'

list of scripts loading
<body class="path-frontpage page-node-type-page" data-new-gr-c-s-check-loaded="14.1002.0" data-gr-ext-installed=""
cz-shortcut-listen="true">

<script type="application/json" data-drupal-selector="drupal-settings-json">
    {
        "path": {
            "baseUrl": "\/",
            "scriptPath": null,
            "pathPrefix": "",
            "currentPath": "node\/1",
            "currentPathIsAdmin": false,
            "isFront": true,
            "currentLanguage": "en"
        },
        "pluralDelimiter": "\u0003",
        "suppressDeprecationErrors": true,
        "ajaxTrustedUrl": {
            "form_action_p_pvdeGsVG5zNF_XLGPTvYSKCf43t8qZYSwcfZl2uzM": true
        },
        "user": {
            "uid": 0,
            "permissionsHash": "508c848d9cf616f3b3735479b8cad945e128b7dbb0a534206170c7d3643afe05"
        }
    }
</script>
<script src="/core/assets/vendor/jquery-once/jquery.once.min.js?v=2.2.3"></script>
<script src="/core/misc/drupalSettingsLoader.js?v=8.9.13"></script>
<script src="/core/misc/drupal.js?v=8.9.13"></script>
<script src="/core/misc/drupal.init.js?v=8.9.13"></script>
<script src="/themes/custom/wcsb/js/bootstrap.js?v=8.9.13"></script>
<script src="/themes/custom/wcsb/js/owl.carousel.min.js?v=8.9.13"></script>
<script src="/themes/custom/wcsb/js/popper.js?v=8.9.13"></script>
<script src="/themes/custom/wcsb/js/scripts.js?v=8.9.13"></script>
<script src="/modules/contrib/commerce/modules/cart/js/commerce_cart.js?v=8.9.13"></script>

console errors


texts: Will deleting the Body Field from one Content Type also delete this field from other Content Types?

texts: When creating a new Content Type that does not need the body field, is it safe to just delete the body field from that new Content Type without affecting other Content Types?


texts: Change #default_value of a textarea on admin pages

texts:
I need to change specific textarea max-length (currently 100 letters).

Where is the default value stored or how it is possible to override this setting?


texts: Drupal permission resticted to own node in relation to another one

texts:
I have a pretty nasty problem with events and venues in Drupal. Let say that registered user can add a venue - there is no restrictions. Now I want to make users able to add an event but this one can be assosiated to users own venue not to others. How to limit this access?

I have both events and venues as nodes.

Any ideas?

Cheers
Pawel


texts: Best practice: Twig template for custom module's block

texts:
I'm looking to provide a template for a custom block in my custom module. There are two ways to go about this: provide a template for just the block's content, or provide a template that extends block.html.twig. I've returned empty-handed in my search for a best practice. Let me clarify the two options to provide a template for my custom module's block:

Option 1: provide a template for the block's content

<?php
/**
 * Implements hook_theme().
 */
function mymodule_theme($existing, $type, $theme, $path) {
  return array(
    'mymodule' => array(
      'variables' => array('var' => 'test'),
    ),
  );
}
?>

The template named mymodule.html.twig looks like this:

This is my content: {{ var }}

Option 2: extend block.html.twig

<?php
/**
 * Implements hook_theme().
 */
function mymodule_theme($existing, $type, $theme, $path) {
  return array(
    'block__mymodule' => array(
      'base hook' => 'block',
      'variables' => array('var' => 'test'),
    ),
  );
}
?>

The template named block--mymodule.html.twig looks like this:

{% extends "block.html.twig" %}
{% block content %}
This is my content: {{ var }}
{% endblock %}

Looking for a best practice

The documentation on Twig Template naming conventions is quite clear on this: for a block, the name should be block--module.html.twig. However, is that the filename a themer would use to overwrite my block content (option 1) or is it the filename I should use for the template I provide for my custom module (option 2)? I haven't found a clear answer on this so as far as I can see there's no best practice on this yet.


texts: Not having the permission to update menu path

texts:
I was trying to modify the path of the navigation menu link already created via admin/build/menu-customize/navigation.  I am getting the following error

When i try to create the new menu also i am geting the same error . any idea ?

I given the permission to menu module and enabled the path module too .


texts: REST GET ResourceResponse returns encoded json

texts:
I have a decoupled drupal project with an angular 5 front end that is utilizing a restful api to store data.  Because this API needed a key that we didn't want to expose we have created a restful endpoint in the Drupal code that acts as a sort of proxy.  The front end hits Drupal, Drupal adds the key, hits the api, and then Drupal returns the api's response to the front end.

When I hit the API directly, I get clean JSON:

{"total":610,"results": .....

But when I use the proxy, I get encoded json:

"{\u0022total\u0022:610,\u0022results\u0022:[{\u0022_id\u0022:\u .....

My Angular request:

get(): Observable<RecipePreview[]> {
    let encryptedAuthorizationString = 'BLAHBLAHBLAH';
    const headers = new HttpHeaders()
        .set("Content-Type", "application/json")
        .set("X-CSRF-Token", this._HttpServiceService.csrfToken)
        .set("Authorization", "basic " + encryptedAuthorizationString)
    ;

    let u = this.filter.url();

    return this._http.get(u,{headers})
        .map(res => {
                return res;
            }
        )
    ;
}

The Drupal RESTful endpoint code looks like this:

/**
 * Responds to entity GET requests.
 * @param $data
 * @return \Drupal\rest\ResourceResponse
 * @throws \GuzzleHttp\Exception\GuzzleException
 */
public function get() {
    $url="BLAHBLAHBLAH";

    $client = \Drupal::httpClient();
    try {
        $request = $client->request('GET', $url, [
            'headers' => [
                'Content-Type' => 'application/json',
                'apikey' => "BLAH-BLAH-BLAH"
            ],
        ]);

        $file_contents = $request->getBody()->getContents();
    }
    catch (RequestException $e) {
        //An error happened.
        $file_contents = "There was an error.";
    }

    \Drupal::logger('Proxy API')->debug($file_contents);

    return new ResourceResponse($file_contents);
}

I'm pretty sure that ResourceResponse is doing something to the json, and there has got to be a way to tell it to not do it anymore?  But how?  Thoughts?

I'm also using the same final end point in a drupal content migration from source and I believe this formatting is causing issues with that as well.

Thanks so much for helping me out with this!


texts:
I am using image_style_url to get a thumbnail of a picture I added through the administrator interface.

// $foo->field_picture['und'][0]['uri'] has value public://foo.jpg
image_style_url('foo-thumb', $foo->field_picture['und'][0]['uri']);

The API states that the image will be created when the URL is requested. However, when visiting the page the image isn't displayed (404). The URL returned from the function seems to be well formed, but the file hasen't been created.

The 'foo-thumb' folder is in the public data folder and the file permissions should be OK. I tried flushing the image cache (drupal image-flush foo-thumb) but still no results.

Any ideas?


texts:
I have added the following JS to a node form, it clones the submit button but clicking it inside the dialog (which does show up) doesn't submit the form in the browser, just nothing happens when the button is clicked. I also tried adding the button server side, same results:

(function (window, Drupal, $) {
  Drupal.behaviors.drafter = {
    attach: function attach(context) {
      var button = $('#edit-submit');
      var newbutton = button.clone().prop('id', 'edit-submit-drafter');
      button.click(function () {
        $('#drafter-elements').toggle();
        var confirmationDialog = Drupal.dialog('#drafter-elements', {
          resizable: false,
          closeOnEscape: false,
          create: function () {
            $(this).append(newbutton);
          },
          beforeClose: false,
          close: function (event) {
            $(event.target).remove();
          }
        });
        confirmationDialog.showModal();
        return false;
      })
    }
  }
})(window, Drupal, jQuery);

Where drafter-elements come from:

$form['drafter'] = [
  '#prefix' => '
',
  '#suffix' => '
',
  '#attached' => ['library' => ['drafter/drafter']],
];
$form['drafter']['save_in_place'] = [
  '#title' => 'Confirm',
  '#type' => 'checkbox',
  '#description' => t('By default a new draft will be created.'),
];

With a tiny CSS:

#drafter-elements {
  display: none;
}

(Here's the drafter repository should someone want to try it / fix it.)


texts: Drupal website goes offline every 2 days for 15 minutes

texts:
We provide hosting services (Dedicated Server) to a client whose website is based on drupal. This month, his website goes offline for 15 minutes every 2 days.

We already have monitoring tools (i.e pinguzo) showing that the server never went down. And the log files show nothing that is related to this issue. Also, there is no crontab entry executing every 2 days.

And we already checked the website many times at the same hour, but we never encountered the website while offline.

Nevertheless, the client still sends reports about this issue, and we do not know what could be the culprit.

Where should I look? Is there anything in drupal that can cause this?

Thank you.


texts: How to eliminate access to page based on the user ID?

texts:
I want to control the access of a page based on the user ID and the value of some other fields.

For example, if I am logged in as user #5, I have access to user/5 but I don't have user to the page user/6 and administrator users have access to both pages.

In my case, imagine I have a custom user page and I want to give access only to the owner and to the user selected in a custom field.

I don't think I can achieve that using permissions and in the future I might have more restrictions based on the value of other fields. So ideally, I would like to have a function where I will get the uid and the value of the fields, I will do my checks and I will restrict the access or not.

By the way my pages are panel pages not nodes.

Any idea/help/suggestion?


texts: How to iterate multi dimensional array and pipe each sub array to another plugin as input in Migration yml

texts:
I am migrating CSV data into Nodes and Paragraphs in Drupal 8.
I have field in CSV file which has JSON data, I have written a process plugin to convert JSON data to multi-dimensional array.
I would like to know a way to pass the each sub array to my another custom process plugin. Is there any such process plugin available to pipe sub array from parental array in core migrate or through migrate_plus module.
I am looking for something similar so that it passes only sub array into the final custom process plugin.
  pseudo_field_country_time_zones:
    - # plugin which converts JSON data to multi dimensional array.
      plugin: country_timezones_data_formatter
      source: timezones
    - # not sure if this is correct plugin to process array.
      plugin: sub_process
    -
      plugin: country_timezones_paragraphs

You might ask why cant you process the data in the country_timezones_paragraphs process plugin itself. That plugin is being used by other process, so dont want to change it. Other solution for me is to write another process plugin but it will be just code duplication with foreach loop added to country_timezones_paragraphs.
I believe there is already a plugin available either from migrate or migrate_plus module for this scenario , but not able to identify what it is.

$input_data = '[{"zoneName":"Africa Ceuta","gmtOffset":3600,"gmtOffsetName":"UTC+01:00","abbreviation":"CET","tzName":"Central European Time"},{"zoneName":"Atlantic Canary","gmtOffset":0,"gmtOffsetName":"UTC\u00b100","abbreviation":"WET","tzName":"Western European Time"},{"zoneName":"Europe Madrid","gmtOffset":3600,"gmtOffsetName":"UTC+01:00","abbreviation":"CET","tzName":"Central European Time"}]';

Decoded JSON array.

$decoded_array = var_dump(json_decode($input_data, TRUE));

Array
(
    [0] => Array
        (
            [zoneName] => Africa Ceuta
            [gmtOffset] => 3600
            [gmtOffsetName] => UTC+01:00
            [abbreviation] => CET
            [tzName] => Central European Time
        )

    [1] => Array
        (
            [zoneName] => Atlantic Canary
            [gmtOffset] => 0
            [gmtOffsetName] => UTC±00
            [abbreviation] => WET
            [tzName] => Western European Time
        )

    [2] => Array
        (
            [zoneName] => Europe Madrid
            [gmtOffset] => 3600
            [gmtOffsetName] => UTC+01:00
            [abbreviation] => CET
            [tzName] => Central European Time
        )

)


texts: How can I create a "show full article" button that bypasses smart paging?

texts: I am using smart paging currently but would like to create a button above my articles that would show the entire article on a single page (canonical link) that would also have no pagination (bypass smart paging entirely for that link). I'm not finding any solutions on how to do this. Is it even possible? These links are for search engine indexing so that the non paginated version would serve as a landing page for search results traffic.


texts:
Using feeds, given a URL, I would like to get the content of a file into a node text field.
In the case of an image, I can map the image URL to a image field and see the images on the page. If I do the same with a text file, I just get the URL showing up, not the file content.
If I change the field type to file, I get a link to the file.


texts: Move Drupal site from localhost to remote production server

texts: I want to move my Drupal 7 site to a remote server. I searched the Internet for a solution, but the information I found were cluttered. Can someone care to write step-by-step how-to or provide a link?


texts: Referencing "type" in nodes returned by loadMultiple();

texts:
I know there are easier ways to sort nodes by type, using views, or using:

$query->loadByProperties(['type' => 'my_content_type']);

... but what I really want to do is return ALL nodes and then do different things based on the type field, like so:

$result = \Drupal::entityQuery('node')->execute();
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($result);

foreach ( $nodes as $node ) {
  if ( $node->type == "my_content_type" ) {

    // do something...

  } else {

    // do something else...

  }
}

However, my condition is never getting met, so I can only conclude that I am referencing the node type incorrectly. What am I doing wrong?


texts: Commerce view of node checkout hides unpublished content, therefore can't relist

texts:
I'm using commerce node checkout and have enabled the predefined view, Commerce Node Checkout Expire Posts (Content) to give customers a list of content they've paid to publish.

The problem is, when the content expires and is unpublished, it disappears from the view output. This is problematic because that view contains the 'relist' button, meaning that customers can't relist expired content.

Has anyone found a workaround for this? (Or maybe I'm missing something?)


texts: How can I replace the hyphens in front of child terms with something else?

texts:
What code is responsible for adding - in front of taxonomy term sublevels on a taxonomy field in a node edit form?

Even though the most non-intrusive way to override it is preferred, I'm comfortable even with core patches.


texts: Display Special Characters in Drupal Forms API

texts:
I have a variable fetch from database which contains special character ñ. For Example:

$student = 'Evangeline O. MontañO';
$student = 'Rosalyn G. QuiñO';

Displaying it in my form causes ajax error, but when I use check_plain function it returns an empty string and no ajax error occur. How can I display a variable with special characters on it without causing ajax error?


texts: traslation view with geofield and openlayer

texts:
i have a view format geofield map , i have build with openlayer  some positions and area on the map , in french the map is displayer with markers and area and i can have link from this markers  and area to content  , but when i choose arabic with arabic selector , the map and markers are not displayed
i can't found solution for displaying map in arabic . The translation for other view is good
can you help me please
i have drupal 7.41
openlayer 7.x-2.0-beta11
geoPHP 7.x-1.7+7-dev
Geofield Map 7.x-2.3
Views translation 7.x-3.x-dev


texts:
I need to develop a search form with two differents taxonomy (taxo1,taxo2).

When a user selects in taxo1 la term, the second list has to be shown with inside only corresponding taxonomy terms.

Here is a example: if the user selects term departement in the first taxonomy taxo1 (using a select list), then a second select list (with terms from taxo2) should appear with only towns from the department previuously selected.

I can't do that with Views because filters can not interact.

Can anybody give me a way to do this?


texts: Content display errors - Missing styling and content

texts:
I have a local Drupal 7.2.6 installation that I am experiencing a strange issue with.  If I log in and go to Find Content the it displays my content as expected.  Clicking on an item takes me to the relevant page and everything looks ok,

However a few of the content items take me to a page that looks like this....

Anyone any ideas?


texts: JavaScript supposed to always be called on front page, but doesn't always run

texts:
I have some JavaScript that is called on the front page, and is supposed to execute.  When I go the page initially, it works fine.  Then if I go to another page, then come back, it doesn't show.  It does load, and after other JavaScript files it requires.  It just doesn't execute.  If I refresh, it loads again.

(function ($) {

    Drupal.behaviors.chartSavings = {
        attach: function (context, settings) {

            // .....

            // create the submit handler
            $('#savings-form').submit(function(event) {

                event.preventDefault();
                //alert('Form submitted xxx');

                savingsplot();

            });

            savingsplot();

        }
    }

})(jQuery);

What am I doing wrong?  I don't have any caching enabled, and in drupal_add_js(), I set cache to FALSE.


texts: How to integrate webform into multi form wizard into drupal 7

texts: I am trying to integrate webform into multiform wizard in drupal 7. but its not working, i dont have any idea how to integer it. if it is not possible to integrate awebform into multiform wizard then is there any alternate solution to do the same like wizard format.


texts: Call a function in one of the modules from a custom PHP file on my Drupal site

texts:
I need to run a function in one of my module. This function is perfectly visible throughout my drupal site.

For one of my option, I have to run this function when colorbox loads. I have no idea which PHP file is called when the colorbox opens. I do know where the JS code is when colorbox opens, so what I did was this:-

...
...
inline:function(){
        $.get("sites/all/themes/my_theme/set_session2.php");
        return $.urlParam('inline', $(this).attr('href'));
      },
...
...

In this way, I can run a php file where I placed that function. Problem is that function is not visible in this PHP file.

Is there any way, I can get through this problem?

Best.


texts:
I am trying to remove the <fieldset> surrounding a date popup field, but I find that the label is also removed. This is my code:

function mymodule_profile_form_alter(&$form, $form_state, $form_id) {

  global $user;
  //print_r($form['field_last_name']);

  $form['field_birthdate']['und'][0]['#theme_wrappers']=$form['field_birthdate']['und'][0]['#theme_wrappers'][0];
}

Can anyone help me to solve this problem?


texts: Custom install profile calls another install profile

texts: I want to create a custom install profile that will switch on some modules. I want it to be based on the open atrium profile. Ie Run the OA install profile and then switch on some additional modules. Is this possible?


texts: Views menu options moved to top of structure menu, no obvious way to move them

texts: I had a funny thing happen, where the views menu options got moved to the top of my structure menu in the admin panel, specifically the "add view," "add view from template," and "import" are all at the top of the structure menu over blocks. There's no obvious way to change this in menu management, so I'm not sure what happened and how to undo this?


texts: Custom html.tpl.php file is not getting picked up

texts:
I have a page with a url alias of say /food/tacos

I have created html--food--tacos.tpl.php to include some javascript only on that page. I've used this method many times (on other sites) with no problems, but Drupal (7) doesn't seem to be picking it up this time.

I have cleared all caches.

Theme debug offers the following suggestions, none of which seem to recognize the path alias. I would prefer to use the alias as I may use this theme in multiple places where the node number would not be the same.

<!-- THEME DEBUG -->
<!-- CALL: theme('html') -->
<!-- FILE NAME SUGGESTIONS:
   * html--node--3.tpl.php
   * html--node--%.tpl.php
   * html--node.tpl.php
   x html.tpl.php
-->
<!-- BEGIN OUTPUT from 'sites/all/themes/mytheme/html.tpl.php' -->

How can I get this working with the alias?


texts: Drupal commerce: Purpose of utilizing different product types?

texts:
I'm trying to figure out product types in Drupal commerce. Why would you want to use more than one product type?

Couldn't you just use one product type?

I could see that different product types have different fields. Is that the primary reason?

Or is it because there an ease of use for utilizing product types in views?


texts: Text in published article on front page not showing

texts:
I have no idea what happened (I had to reupload the site and am working on putting all the data back up), but I cannot get the trimmed version of my article appear in the content block on the front page (see screenshot).

I have tried all options in the manage field and manage display I think, and the only time text is shown is when I opt that the entire article is shown on the front page--which is not acceptable. I have put the break tag in and out of the body text too, so I'm rather desperate now for an answer (mostly because I was supposed to launch the site 2 hours ago and all I've done for the past 4 hours was trying to regain data haha--but that's got nothing to do with my current question...)

I hope someone can shine some bright light so I can solve this. Thanks in advance! :)
Screenshot:


texts: How to create a menu with background images for list items?

texts: How would you make a menu that have a different background image for each <li> element in the menu?


texts: What is the easiest way to get the value of a string field in a twig template?

texts:
I'm using Drupal 8.5.4 and Bootstrap Paragraphs. I have a custom module foo and a custom paragraph type bar defined within. In the template for bar, I use kint to inspect the content of the variable. It turns out it has 17 properties, and none of them are the value of the field. The first 14 of them are in core/lib/Drupal/Core/Field, L#89-102. The last 3 are 0, #cache, and weight.

Digging into the object, I found the field value in content.bar.0['#context'].value. Obviously using this method to access a simple field value is janky as hell, and I would prefer not to have to do this every time.

Two questions:

Is there a simpler way to access the field value? I don't mind using a twig filter if need be
Is there a way to configure my paragraph types to pass the context to the template, rather than all of the field data?


texts: How to create Media video youtube entity programmatically?

texts:
I have file with multiple Youtube URLs such as:
https://www.youtube.com/watch?v=asddasOds32
https://www.youtube.com/watch?v=kjh234hknnn
https://www.youtube.com/watch?v=iZ53yuirewn
...

I need to fill Media content with video entities with data from this file.
Can I have some example code to solve this task?


texts:
I'm not entirely certain that this question belongs here but here goes. I've built a pretty basic Drupal site for a department at my University but now I need to migrate it from my laptop to the public. In order to do that I have to jump through a -lot- of hoops with the ITCS department of my University but the site needs to go live pretty soon (within the next 4 days or so) because it's currently hosted on my laptop and I'm leaving the country.

So, what I was wondering is: is there somewhere that I can put this thing for free for a while so that the folks I'm working with can get used to it and show it off (it's for grant purposes) while I work with ITCS to get it up on University servers?

I can't really do it and they don't have any one who can show them how (I'm working remotely) so it's been a pretty big hassle getting this thing off the ground.

Thanks!


texts: How to remove the submit button on the form included by drupal_get_form?

texts:
I have a hook_field_widget_form where I call drupal_get_form multiple times.

Here is my code:

foreach ($suppliers AS $supplier_id => $supplier) {
    $delivery_information = sbsl_order_delivery_information_new();

    $element['suppliers'][$supplier_id] = array(
      '#type' => 'fieldset',
      '#title' => $supplier['supplier_information']['visible_name'],
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );

    $delivery_information_form = drupal_get_form('sbsl_order_delivery_information_1_form_' . $supplier_id);
    $element['suppliers'][$supplier_id]['delivery_information'] = $delivery_information_form;
  }

How can I remove the submit button on the form included by drupal_get_form, and only use the submit of hook_field_widget_form to submit all the forms included by drupal_get_form?


texts: How can I set a node reference programmatically?

texts:
I'm trying to write a custom PHP action in Rules module.  Each time after creation of a certain type of content, it should create an additional node with a reference to the created node.( Field by Node reference module )

I've tried to pass the values of nid and/or title of the main node to this field using tokens and it didn't work.

If the field is a text field it passes the variables correctly.

What value should be passed to the node reference field to set it in code?


texts: How to access custom files in drupal multi site via url

texts:
My site folder structure for drupal multisite is as follow:

-example.com.uk
--vendors-dir
---create.php

How can i get the url example.com/uk/vendors-dir/create.php execute create.php?
As of now i get the 404 error when i execute example.com/uk/vendors-dir/create.php.


texts: Using a module controller to create a page that is more than just a div from the twig template?

texts:
I am using a custom module to create a new page on my Drupal 8 site.

My routing.yml file is configured like this:

mymodule.print:
  path: '/print-mymodule'
  defaults:
    _controller: \Drupal\mymodule\Controller\MymodulePrintController::content
  requirements:
    _permission: 'view mymodule entity'
  options:
    _auth: ['basic_auth']

MymodulePrintController::content is as follows:

public function content() {
    return array(
        '#type' => 'page',
        '#theme' => 'mytheme'
    );
}

mytheme is used everywhere else on my site.

In mytheme.theme, I also have a mytheme_preprocess() function which is adding some blocks to the page. I am guessing the theme is being detected properly because this function is executing just fine. The template I am using is named according to twig's suggestions and is loading fine.

The problem is that the content() function is not really outputting a "page". Using Postman, I see that the entire contents of the response is just a div, there is no <html> tag, no <head>, no <body>, nothing else except what is defined in the one twig file and mytheme_preprocess. I need this page to be using this theme's css styles like the rest of my pages are.

How can I accomplish this? Every guide/question I've seen on the topic so far either is just returning a render array in the content() function like I already am doing, or is suggesting to use Response classes without enough detail for me to really understand.


texts: How to get the correct 'base hook' to override a template file in a custom module?

texts:
How can I find the 'base hook' to override a template file using a custom module?

'node' and 'user' are pretty straightforward, but others can be a little more elusive.

Example code...

MYMODULE.module:

/**
 ** Implements hook_theme().
 **/
function MYMODULE_theme($existing, $type, $theme, $path) {
  return [
    'username' => [
      'template' => 'username',
      'base hook' => 'how do you get this?',
    ],
  ];
}


texts: want to make user-login before view contain

texts:
i am making a online tutorial site where a user can view can different contain but i want then to go through login.

For example: you have a home page. after login, user get redirected to the video page. but i dont want to display video page at the homepage.


texts:
When I enable the bigpipe module most of the blocks disappear, since I use a Vue layer. I've tried the following codes but none of them have worked for me:
  var charging_blocs = $('[data-big-pipe-placeholder-id]').length;
  if (!charging_blocs ){
    console.log('This is executed just once, when all bigpipe blocs are loaded');
  }

  var checkReadyState = setInterval(() => {
    if (document.readyState === "complete") {
      clearInterval(checkReadyState);
      console.log('Page is loaded.');
      /* Put your code logic here */
      (function ($, Drupal) {
       console.log('enters here');
      })(jQuery, Drupal);
    }
  }, 100);

Is there a js event on bigpipe to detect that all blocks have been loaded?


texts: Creating a views reference list to be used in a node reference

texts:
I am using a view to create a limited list of nodes of a certain node type in a node reference. E.g. A logged in user may only select nodes she has created.

I am using a contextual filter in a references view. The contextual filter is set to:
Provide default value = User ID from logged in user
and:
Exception value = 1

So while a user may see her nodes only, the super user may see everything.

I like to add a third condition so that any user with the role of editor can see everything as well. Can anybody tell me how or point me in the right direction on how to approach this? I am running out of ideas.

Update: The exception actually doesn't work either. So the questions is: How can I create a references list where:

the owner can see only her nodes
UID 1 can see all nodes
a user with role editor can see all nodes


texts: Adding a new taxonomy term from a custom content type field

texts: Is it possible to automatically add a new taxonomy term (related to certain vocabulary) from a field in a custom content type; so when submitting a new content entry (related to that custom content type) I add a new taxonomy term related to that entry to create a richer tagging functionality by time for future entries?


texts: Removed default login by mistake and logged out. Can't login

texts:
I made the mistake of removing the user login block through the web interface, and logged out.

Now, I don't have the login interface anymore. Does anyone know how to solve this or is re-installing the only solution?

Furthermore, when I access example.com/user, the log-in form is shown, but it doesn't accept my credentials anymore.

I think I have found the "issue": The login page on mysite/user is the default login page for mysite; however, the default login block that is displayed on the front page is the login for the Drupal 7 web interface. These two are completely separate, that is why my credentials weren't working on mysite/user.

So in conclusion, if you removed the default login block and logged out of the drupal 7 web interface, then you are in troubles.

Please correct me if I'm wrong.


texts:
In addition to the validation that already takes place using the addressfield module, I'd like to check for (and fix) items like:

Building to Bldg
Room to Rm
Circle to Cir
Avenue to Ave

Is there a module that would do this?
Is this best done with a custom module or using JavaScript?

Any chance that this module might be helpful?
https://www.drupal.org/project/field_validation


texts: How to update non-property value with entity_metadata_wrapper?

texts:
I wish to update values in commerce_payment_transaction entity. I am using such code:

<?php
$transaction = commerce_payment_transaction_load(58);
 $digests = array(
'DIGEST' => '456',
'DIGEST2' => '478'
);

$transaction_wrapper = entity_metadata_wrapper('commerce_payment_transaction', $transaction);
$transaction_wrapper->payload->set($digests);
$transaction_wrapper->field_my_custom_field->set(1458);
$transaction_wrapper->save();

The problem is, that such code throws me error, that payload is not property of commerce_payment_transaction entity. Although "payload" is column in database table of this entity type. But it is not set as property.

When I don't use entity_metadata_wrapper, this code works for me:

<?php
$transaction = commerce_payment_transaction_load(58);
$digests = array(
'DIGEST' => '456',
'DIGEST2' => '478'
);
$transaction->payload = $digests;
commerce_payment_transaction_save($transaction);
?>

But is it possible to use also entity_metadata_wrapper to update data of entity, that are neither properties nor fields, like payload in commerce_payment_transaction?


texts: how to use hook_user_login to catch username and password

texts:
I am trying to catch the username and password which are entered on the user login form. This is my code:

function impak_integration_user_login(&$edit, $account) {
  drupal_set_message("Welcome User!" . print_r($edit). print_r($account));
  global $user;
  drupal_set_message(print_r($user));
  }

The hook does work, as It does print out the Welcome message after login. However, I can't figure out how to get any of the user information, specifically the entered username and password.


texts: Allow Authenticated User (non-group member) to Assign Task/Event/Form to a Group

texts:
I'm trying to figure out how to accomplish this:

Allow any authenticated user to submit a form to Groups A through Z.
Members of Group A can view forms submitted only to Group A, and respond by updating the form with a file.
It has to be secure, so filtering by the PHP url won't work.

I'm flexible with how this happens. Right now, using the CRM as a backend, I have an EntityForm that can be assigned to a CRM object, but I cannot figure out how to link a user to a CRM object to filter the EntityForm submission.

I've also contemplated hacking together some type of multi-merchant marketplace where tasks are submitted in the form of "orders" and each "merchant" can fulfill their orders that way, but I feel that has to be overkill for what I'm trying to do.


texts:
I created a block view of my articles. The display format is grid bootstrap.

How to create a clickable area on the whole block view?

I want all my block (not just the fields, but the whole block) to be clickable and dirrige to /node/nid

"Additional attributes" can it be useful to create the link ?


texts: Hash method not providing password that is stored in database

texts:
I created a custom form for the registration, but I am not getting how to store the password in hash format in the database.

I am using the following code, but I am not getting the value Drupal saves in the database for the password.

require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
echo user_hash_password('taliadmin');

Why am I getting a different value?


texts: Possible to extract multiple key/value pairs (links) from string in CSV and migrate into multiple link field

texts:
I am using migrate source CSV and trying to extract a string which contains multiple key/value pairs of links in format:

"Google.com|https://google.com,Yahoo.com|https://yahoo.com"

I need to save the values into a multiple link field.

The logic I need to run is:

- Explode the string on comma ,
- Iterate each item
  - Explode string on pipe |
    - Extract index 0
      - Store to field_link/title
    - Extract index 1
      - Store to field_link/uri

I have it working using a custom process plugin but would like to try and achieve this if possible through chaining of the core process plugins in the migration config yml file.

Thanks


texts: just want to ask if there are any other suggested alternatives for cloning a node for drupal 7. Now I know most of you will answer "Node Clone Module", but is there any other module out there that can do the same thing? Thanks.


texts: Access to private files change after deleting parent node where it was originally attached

texts:
I just ran into a situation where access to private files changed after its deleting parent node.  I confirmed that anonymous users do not have "View private files" permission. If the node is unpublished, access to the file is denied. If the node is deleted, then access is granted to file by anonymous users.

It looks like this has been addressed in the past, but after reading (and re-reading) the issues below, I couldn't identify if this is a bug that needs to be re-examined in 8.4 or if things are working as designed and I'm soliciting feedback as a result.

The file_entity module is also in-play on the site and the following issue may be particularly salient.

https://www.drupal.org/node/2892628

See also:

  "Private files that are no longer attached to an entity should not suddenly become accessible to people who couldn't see them before"

https://www.drupal.org/node/2461845


texts: how to import some content to a new site?

texts:
site A powered by drupal 6 whch has a content type news. there are many articles under it.

site B is a new site. which powered by drupal 6 too. now i only want to import those articles in site A to site B. how do i do? thank you.


texts:
I can't find the "Administer" menu or it's members "Content Management" or "Site Building". I've tried disabling and re-enabling the core menu module, but still cannot see these menus. This is what I can see.

Any ideas why? Or a known solution?


texts: How do I track if a user is logged in on multiple devices and computers?

texts:
I have video content behind a paywall and want to make sure that each user is only logged in from one computer, or device at a time. If they are logged in on the computer watching videos, I don't want their friends to use the account to log in and watch videos from a different computer, device or IP address.

How do I enforce this?


texts: What may cause Column not found (nid) in on clause?

texts:
I'm using Drupal 7.14 and Entity API and Reference 1.0-rc3.

And I'm also using i18n, entityreference (not References) and field_sql_storage.

I get this error when saving a node that has some custom fields using references.

  PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'field_data_body0.nid' in 'on clause': SELECT
  field_data_body0.entity_type AS entity_type,
  field_data_body0.entity_id AS entity_id, field_data_body0.revision_id
  AS revision_id, field_data_body0.bundle AS bundle FROM
  {field_data_body} field_data_body0 INNER JOIN {node} node ON
  field_data_body0.nid = node.nid WHERE (field_data_body0.deleted =
  :db_condition_placeholder_0) AND (field_data_body0.entity_type =
  :db_condition_placeholder_1) AND (field_data_body0.bundle IN
  (:db_condition_placeholder_2, :db_condition_placeholder_3)) AND
  (field_data_body0.entity_id IN (:db_condition_placeholder_4)) AND
  (node.language IN (:db_condition_placeholder_5,
  :db_condition_placeholder_6)) ORDER BY field_data_body0.body_value
  ASC; Array ( [:db_condition_placeholder_0] => 0
  [:db_condition_placeholder_1] => node [:db_condition_placeholder_2] =>
  news [:db_condition_placeholder_3] => page
  [:db_condition_placeholder_4] => 25 [:db_condition_placeholder_5] =>
  it [:db_condition_placeholder_6] => und ) in
  field_sql_storage_field_storage_query() (linea 577 di
  /home/morpheu5/web/xdatanet/modules/field/modules/field_sql_storage/field_sql_storage.module).

What bothers me is that, first of all there's a zero appended to the name of the table, and second, if I add that nid column to that table, Drupal is happy and everything seems to work.

I suspect there must have been some update gone horribly wrong, since maintenance is not under my control, and I had to implement some new features working on my local copy which at that time was already completely out of sync with the client's staging and production servers.

I tried a number of patches, and I've gone through the code myself but I'm not this familiar with Drupal.

EDIT

It seems the nid column is getting added at some point in function preExecute in includes/database/select.inc specifically at row 1236

drupal_alter($hooks, $query);

the hooks acting here are

query
query_entity_field_access
query_node_access
query_entityreference

but after a hour long investigation I only came up with a huge headache, and I'm still not sure if I actually found and debugged all of those hooks. As far as I could see, the nid column is not present before the drupal_alter call while it is after, but it's there at the beginning of each hook_query_TAG_alter I was able to find.

I must be missing something.

EDIT 2

The culprit seems to be i18n, specifically i18n_select, more specifically at row 137 of i18n_select.module where it adds the nid column.

EDIT 3

There, I opened a bug: https://drupal.org/node/1679646


texts:
I wanted to provide a feature to autosave the data while adding the article so that user can restore the content in the event he goes to some other page.

For that I am using Autosave module. I have installed it and set it for my content type. But it is not showing any kind of message that form has been saved.
Also I have checked that it is not running in "Stealth Mode", so it must give message that it has been saved.

Is there anything I am missing. I am using drupal 7 and latest version of autosave ie 7.x-2.1

Also it would be better if someone could suggest some other module that helps to accomplish this.

-- Thanks


texts:
I have the nid of a node and I want to get one of its fields' value. Right now I am doing a node_load on the nid and then using field_get_items to get the value. Is this the right way? It seems kind of convoluted, and inefficient to load the whole node object for what is essentially a few joins for a single field.

Is there a way I can just specificy the node id and the field, and get its value?


texts: How to "disable" certain paragraph types?

texts:
I am not sure if this is possible or not (which is why I have come to you fine folks), but I have searched for this and still haven't found an answer...

Is it possible to just "disable" paragraph types in a D8 site instead of deleting them? I know you can "disable" content types in D8 and D7, but I just want to disable some of the paragraph types that we have on our customer's sites without completely deleting them in case the need for them happens to come up from individual customers.

When I go to the full list of paragraph types, the only options that I'm given are:

Manage Fields
Manage Form
Manage Form Display
Manage Display
Edit
Delete

So, any help with this would be greatly appreciated, even if it's just to say, 'nope. not possible.' :)

Thank You!
Nicole


texts:
I can't see why it's the case, but one of my site editors cannot edit the content on OG group pages.

Our groups are private, but that users is a member of all the groups in the site and the "site editor" role should allow him to edit any content anywhere on the site.

There are two kinds of groups, which each have their own content type (because they are subtly different), but the role's permissions settings are identical and the "site editor" role has all boxes ticked in the role based access control settings for both the content types. For both the content types, the "site editor" role also has the create, edit (own/any) and delete (own/any) permissions.

The main problem seems to be that the edit menu isn't appearing for that user.

I'm evidently overlooking something somewhere, but I can't just see where. Surely the role doesn't also need "administer Organic groups permissions" granted.

Is anyone able to point me to the obvious mistake I'm making?


texts: Drupal 8 problem to list taxonomy word of unpublished content in a view

texts: I made a view for the backend. Something like we know from backend for listing content. I want to list the taxonomy term for all content. No matter whether content is published or not. But the view only shows content, if content is published. What do I have do to show taxonomy terms for unpublished content?


texts: How to install a specifc commit in Composer

texts:
The commerce_webform_order module (currently in dev status) recently changed one of its dependencies from Webform 5.x (stable) to Webform 6.x (alpha). I want to temporarily freeze commerce_webform_module so that Composer keeps it at a particular git commit just before the dependencies changed. I've done this successfully in the past by following a post here but I can't get it to work this time.
I've tried doing
composer require drupal/commerce_webform_order:1.x-dev#30668342035ae3add3a2e5163e84816fc96edd92
or adding "drupal/commerce_webform_order "1.x-dev#30668342035ae3add3a2e5163e84816fc96edd92", in my composer.json file and I've tried shorter versions of the commit hash (30668342) as shown on the drupalcode.org project here.
I keep getting this message
Your requirements could not be resolved to an installable set of packages.
- Can only install one of: drupal/webform[6.x-dev, 5.19.0].
- drupal/commerce_webform_order 1.x-dev requires drupal/webform ^6 -> satisfiable by drupal/webform[6.x-dev].
- Installation request for drupal/commerce_webform_order 1.x-dev#30668342035ae3add3a2e5163e84816fc96edd92 -> satisfiable by drupal/commerce_webform_order[1.x-dev].

What might be causing this? What's changed in the last 6 months since it worked for me on the same module last time?
Can you think of any other work-around that allows me to update everything else without pulling in this latest change and the dependency for an alpha version of Webform?
Thanks


texts: Drupal custom page with wildcards in url not working

texts:
I have created a custom page at admin/structure/pages and have set the path to be

course-details/%id/%name

My intention is that there will be a custom block appearing on this page and the id and the name, in the URI, will pass data to the custom block. I have the block working fine and it is pulling data from a test page URI as expected. I now need to embed this block onto the course-details page, which contains content that must appear for any hit on this page regardless of the id and name.

In the settings => arguments for this page I have set the two arguments to be strings

In settings => access I have set "all criteria must pass"

When I hit the page with no id or name I see the course-details page, at this stage I do not have the custom block enabled, and I am seeing the content that must appear on all course-details pages.

However when I add the id and name, an example is as follows

course-details/ACM20110-01V03/certificate-ii-in-animal-studies

I am getting a 404 error. It seems the id and name are causing me trouble.

I have spent hours hunting on Google for trying to get my head around why this is not working. I am probably doing something silly.

Could anyone please help with this issue.


texts: How can I rebuild a node edit form and hide all elements except confirmation buttons

texts:
In another question I asked Is there a way to alter a node save confirmation form?.  The recommendation was to use hook_form_alter to append a callback to the submit handler that would redirect to a new form where I could implement my confirmation logic.

I have experimented with this and come up short in a couple of areas.  One is ensuring that  callbacks from other modules are not affected.  The other is getting data in the form and form_state arrays from the node edit form to the confirmation form where I can act on it.  It seems that an alternate solution is to use multi-step techniques and 'rebuild' the node edit form like the preview action does.

How can I ensure that when I rebuild the form with some confirmation options that the other form elements are hidden?  In other words I just want a clean form but still retain access to the form and form_state data.  Is there a form property that does this?


texts:
I've got a custom module and have the auto generated LoadTest but it is not working. This is a functional test.

  protected function setUp() {
    parent::setUp();
    $this->user = $this->drupalCreateUser(['administer site configuration']);
    $this->drupalLogin($this->user); // Breaks here
  }

  public function testLoad() {
    $this->drupalGet(Url::fromRoute('<front>'));
    $this->assertSession()->statusCodeEquals(200);
  }

Running this test returns :

1) Drupal\Tests\weekly_digest\Functional\LoadTest::testLoad
User belwfS3e successfully logged in.
Failed asserting that false is true.

/app/web/core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/TestCompatibilityTrait.php:18
/app/web/core/tests/Drupal/Tests/UiHelperTrait.php:254
/app/web/modules/custom/weekly_digest/tests/src/Functional/LoadTest.php:35

When I comment out the drupalLogin call the test succeeds.

The fail is on this line

$this->assertTrue($this->drupalUserIsLoggedIn($account), new FormattableMarkup('User %name successfully logged in.', ['%name' => $account->getAccountName()]));

And if you look at the error from above it's from the TestCompatibilityTrait which had some pretty wacky deprecation errors.

Here is my phpunit env

    <ini name="error_reporting" value="32767"/>

    <ini name="memory_limit" value="-1"/>

    <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>

    <env name="SIMPLETEST_BASE_URL" value="http://changelog.lndo.site/"/>
    <env name="SIMPLETEST_DB" value="mysql://drupal8:drupal8@database/drupal8"/>

    <env name="BROWSERTEST_OUTPUT_DIRECTORY" value="web/sites/simpletest/browser_output"/>
    <env name="BROWSERTEST_OUTPUT_BASE_URL" value=""/>

    <env name="MINK_DRIVER_CLASS" value=''/>

    <env name="MINK_DRIVER_ARGS" value=''/>

    <env name="MINK_DRIVER_ARGS_PHANTOMJS" value=''/>

    <env name="MINK_DRIVER_ARGS_WEBDRIVER" value=''/>

This is using lando.
Why would I be getting these failures? It accesses the site just fine, it seems to be checking if the user is logged in that's causing the issue but I can't find out why.


texts: How do I change a field type from integer to decimal?

texts: I have some fields type integer that are already populated, is possible to change the fields from integer to decimal?


texts: Migrate_d2d: Excluding node import based on a date comparison

texts:
For a migrate_d2d project, D7 -> D7, I wish to exclude the importing of nodes whose date field is less than the current date. My only class overrides are for mapping custom fields. The migrate function is working as I expect. However, we don't need to import nodes whose dates have passed today's date.

The custom node field is not part of the core field data set, so the following:

public function prepareRow($row)
{
    $postDate = $node->field_job_start[und][0][value2];
    if ($postDate < time()) {
        return FALSE;
}

Will not work, as 'field_job_start' isn't accessible until prepare() by which time, apparently, a return FALSE doesn't cancel the row import.

What is the best way to exclude these rows?


texts: Alternative admin-side content browsing - module?

texts:
Does anyone know of, or is working on a Drupal 7 module which would provide alternative, hierarchical content browser on the admin side?

While the filter in the Find Content section is a great aid for unrelated pages, I'd really love to be able to browse through taxonomy-bound PAGES (rather than terms), just like I browse through folders and files in Windows Explorer or Mac's Finder.

What bites me most is that in default Drupal installation, the taxonomies are too much separated (in terms of managing and reviewing the content) from the actual pages. And the pages bound to vocabulary terms are browsable as unrelated ones.

I would be curious to see if anyone found a solution for that.
Regards,

Artur


texts:
Currently I have a date contextual filter. When I click the date field the popup calendar displays. when I click on a date (for example today's date) it displays as 3/18/2014, but I would like it to display as March 18th, 2014. Would anyone know how I should go about this?

Any help would be much appreciated. Thanks!


texts:
i have image upload field in my theme-settings.php

$form['fsos_settings']['intro']['hero']['heroImage'] = array(
    '#type' => 'managed_file',
    '#upload_validators' => array(
    'file_validate_extensions' => array(0 => 'png jpg jpeg gif'),
),
    '#upload_location' => 'public://image/home/',
    '#description' => t("Upload an image."),
    '#default_value' => theme_get_setting('heroImage'),
);

I can print this in my page.tpl.php using the following code

<img src="<?php print file_create_url(file_load(theme_get_setting('heroImage'))->uri); ?>"/>

But i want to use Image Styles (heroimage) for the size. How can i get the image styles URL instead of the original URL


texts:
I do print render a image field in node. I´d like to have to original image size without any styles. But when i take a look on the image path, i see that the image was uploaded to folder "large" and gets a width of 480px. In Node display settings i have set the format to "Original". What else can i do to get the original size rendered? Thanks!

<?php print render($content['field_image']); ?>

Output Browser:

src="http://fake.org/sites/default/files/styles/large/public/field/image/test-image.jpg?itok=FuFLPjDI"


texts: How to use Drupal to encapsule an external site

texts:
This is the scenario: I have a Drupal 6 site, and another website that doesn't use Drupal. This 'other site' is in the same server, and the same hosting account. I need Drupal to be over the other website with his theme, regions, blocks and sessions/roles/authentication. The other website must conserve its own system of session, authentication, content and their URLs (but like already said, the theme, blocks, regions, authentication, must come from Drupal).

Update: iframe is not an alternative (SEO issues).

Update: This guide Integrating third party applications seems useful, but certainly I do not know how to implement it.


texts:
I am attempting to setup an article voting system with the ability to provide feedback to the author. Only admins will be able to see feedback so I do not want it like a review attached at the bottom of each article. My idea was to create a view that only admins had permission to see. Include in this view would be the article name, rating, and feedback if any was submitted. I would like to be able to group the feedback/ratings by article instead of by entry or user and provide an overall calculated rating for the article.

It looks like fivestar is able to do some of this however I do not believe the advanced instructions:"Configuration as a CCK field / Advanced Rating" are for drupal 7. I have created a content type of "Article Feedback" and attempted to follow this answer of how to set something similar up however I do not see anywhere when I create the rating field a "voting target". I do not really understand how Node Reference works and how it will work with the desired result I stated at the beginning of this question.

I am open to using different modules and writing my own PHP script to accomplish this task. Any direction on how to accomplish this is much appreciated.


texts: Block in node view showing but does not show up when rendering node in Views

texts:
I have a node type that I have a specific block added to. I have some AJAX going on in the block. When you view the full node the block shows up.
When I go to Views and render the full node content that block doesn't show up, just the node content.
How can I get the block to show up in Views when rendering the full node?
I've read that maybe Panels would be a better solution than using blocks, especially considering I'm using Views.


texts:
I have a product display using facets that I have tried in vain in views to add a flag/unflag link to with views I already built a separate comparison view with the relationship to flag and the ability to unflag but I want to be able to flag products from the facets display (if it's even possible) rather than a second display that looks the same as the facets display except that it uses content linked to the product entity and wont show the facets

Does anyone know if it's even possible to add a flag to a view of type "Product Display"?(Correction: "Product Display" was the name of my search api index being exposed to views)

For now I have this working by exposing the flag link on the product displays themselves which is a pain in the neck to flip back and forth and some users probably aren't going to be able to be techie enough to figure it out


texts: Is it possible to run hook_field_presave after hook_entity_presave?

texts:
I am using Drupal 7. I use hook_entity_presave() to manipulate geofield data. The geofield module has a hook_field_presave() function, that calculates various data for the field.
My problem is, that hook_field_presave() runs before hook_entity_presave(), so my data is not available to process. I am looking at hook_module_implementations_alter(), but it seems that it does not care about hook_field_presave(), and even if it would know about this hook, I still don't know how to change the execution order of two different hooks. Any idea how to solve this? I could just copy the logic of geofield_field_presave(), but that is not a nice solution.


texts: pager is not working on update of Views 7.x-3.7 to Views 7.x-3.8

texts:
Hi i have recently update one of project and so views module also updated now views pagignation is not working (from views 7.x-3.7 to views 7.x-3.8 version)
any help appreciated
thanks.


texts:
I am using /user/[current-user:uid]/edit to generate the user profile setting page where user can edit there profile.
Sometimes it works and sometimes it displays the wrong user id and sometimes I get an error that id not yet assigned.
Drupal: 8
Project: Menu Token
Version: 8.x-1.0-alpha3


texts: Why does drupal_set_message function encode all html tags?

texts:
Since I updated to Drupal 7.53 the function drupal_set_message does not work anymore as expected, as it encodes or strips all HTML tags.
For example the code:

drupal_set_message("<b>This is important,</b> this not.");

used to print:

  This is important, this not

But since the update it prints:

  This is important, this not.

I could not find any change to that functions mentioned in the release messages. Can anybody explain to me what has happened?

By the way, I am using the Bootstrap theme, what was updates as well. Maybe the Theme is to blame?


texts:
I would like to manage a couple of EC2 instances with Drupal, so instances as entities would be nice (to build a UI, tag them etc). Is there anything in that direction already?

I am looking for:
- Starting Instances
- Stopping Instances
- retrieving and storing the latest network configuration (ip changes everytime you shutdown and start an instance).

Thank you


texts:
I have a view with the following results:

           penalty    attorney_fees   other
client1    100,000    100,000         0

client2    50,000     75,000          10,000

client3    25,000     50,000          25,000

           total?     total?          total?

How do I get the sum of the column "total" for penalty, attorney_fees, and other?


texts: What are the effects of the "access commerce administration pages" permission

texts:
The SA-CONTRIB-2020-020 security patch was titled "Further restrict anonymous user access to anonymous orders."
Unfortunately it seems to have broken some sites I work on.  We are now seeing access denied errors on admin/commerce/orders/xxx for "semi-trusted" users who have permission "Default: Update orders".  For these sites the security patch was a non-back-compatible change and I have raised an issue for that.
The solution that worked for me is to grant the semi-trusted users the "access commerce administration pages" permission.
However I am nervous because this permission doesn't seem to have clear documentation.  I don't wish for these "semi-trusted" users to suddenly gain extra access that they should not have such as to edit products.
Please can anyone confirm the effects of this permission?  Does it do nothing alone and only work if other permissions are added?


texts: Image Styles not creating on one custom style only

texts:
I've run into this issue where we have created a custom style (emailthumb) which is to be used when sending out email newsletters via simplenews. The thumbnail is based on 'thumbnail' style but is slightly bigger. It works fine when the image is being rendered as thumbnail or any other style but not the one custom style.
The permissions of the folders are all exactly the same (I've even tried 777 for emailthumb->public) as in thumbnail but there is no pictures folder being created. I then get a log error of access denied as the URL to the image as the folder doesn't exist.
http://example.com/sites/default/files/styles/emailthumb/public/pictures/image.jpg
I have tried changing the theme as per
image style (imagecache) images are not being created
but this has not worked.
Does anyone have any suggestions?
Current Permissions
sites/default 555


texts:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1118
  Row size too large. The maximum row size for the used table type, not
  counting BLOBs, is 8126. You have to change some columns to TEXT or
  BLOBs:

Database storage Engine : Innodb

Do we have to switch over for MyIsam?


texts: Admin menu link visible to authenticated user

texts:
I am using drupal 7 and i have two types of users for my site: The administrator and the authenticated user.

I want to display to the authenticated user a link in the admin menu sidebar, to see all the content (from a view that i created).

I have created a link in the management menu, called "Show content". As admin, I can see this link but not as authenticated user. Also, I have installed the module "Menu item visibility" and for this menu item i selected the option "authenticated user".  But it is not appearing in the admin menu sidebar for the authenticated user.

So my question is: How can i display an admin menu link for authenticated user?


texts: Can't override module css for Mega Menu in Zen theme

texts:
I am a fresh convert to Drupal and still a novice overall. My problem seems simple, but I just can't figure it out.

I installed a Zen theme, then a Mega Menu module. I am in the process of styling the collapsing menu, so I wanted to copy the CSS from the module to my theme CSS file.

First: I copied the tb-megamenu.tpl.php to my theme in order to add the correct glyphicon. That worked just fine.

Second: I copied the default.css from the module to my css folder. It didn't override.

Third: I changed the name of that file to custom-megamenu-default.css (in case there was some conflict with the file being named "default", and tried to register it in the .info file. It still didn't override the css.

What am I missing?

Note: I have cleared the cache at each step, and I (in the very beginning) created a custom.css file that overrides just fine, without registering in the .info file. I believe Zen aggregates all the css files in the css folder automatically.

Edit:  If it helps here is the address of the site I am using to learn Drupal: www.sandbox.thefinanceplanner.com


texts:
I am using Layout Builder (Drupal 8.7.1)

I have a block in several Layouts. How can I programmatically remove all instances of this block and update all layouts without the message "This block is broken or missing. You may be missing content or you might need to enable the original module." ?


texts: Why are links missing when using the Notify module?

texts:
I use the Notify module. When I select for Mail System (admin/config/system/mailsystem)
the choice DefaultMailSystem, the mail is sent but change line in a small border like this

But when I select HtmlMailSystem, it sent in a line (like what I want) but the links disappear and it looks something like this:

The links only appear in Gmail. In the other mails (hotmail,yahoo) they do not.

Why does this happen?

How could it be correct? In a line with links?


texts: Change Views Handler for entity schema field

texts:
I want to have a numeric value in my db treated as boolean by drupal.

the field is defined in the hook_schema like this

    'myfield'  => array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => FALSE,
    'default' => NULL,
    'description' => "a field",

So Drupal Views module rightfully detects and displays it as a number.
However i want it to be a Boolean, so in my hook_entity_info i have

'views controller class' => 'StrutturaViewsController',

and then

class StrutturaViewsController extends EntityDefaultViewsController {

  public function views_data() {
    $data = parent::views_data();

    $data['struttura']['myfield']['field']['handler'] = 'views_handler_field_boolean';

    return $data;
  }
}

'struttura' is the name of the entity that i created, and the name of the table with the 'myfield' coloumn

My problem is that Drupal is still treating the value as numeric.

Am i missing something?


texts:
I want to implement conditional menus, where different options appear depending on the user's role.

In Display Different Menu links an content depending upon user role or user logged in, user "nevets" suggested making multiple menus each with the appropriate links, and then restricting the visibility of a particular menu by user role.

In my case, the different menus might share a lot of links, so I thought of cloning the links to avoid having to re-enter them when making the second and subsequent menus.

I found the Menu clone? module, but the project page warns:

  D7: This module is still in beta and is a complete rewrite of the original port. It is never recommended to use beta versions on a production environment. Please keep a backup of your database to avoid problems later on.

How can I achieve this? any suggestions?


texts: Conditional display of CCK field for certain profiles values

texts:
I have created a content type with CCK on Drupal 7, and I would like to display only a few fields according to certain values in their profile2 type.

Concretely, I have a profile2 field to specify if the member is VAT registered or not. When the members are submitting their invoices, I want to display specific fields if they are VAT registered.


texts: Difference between Field and Field Instance?

texts:
When we go to the path /admin/structure/types/manage/article/fields and use the Add new field option or the Add existing field option, does that create a field, create a field instance or attach a field instance? How to differentiate between them? So, programmatically, when to use field_create_field, field_create_instance and field_attach API?

In the field API documentation it only mentions the admin UI and never talks about the path where to create both fields and field instances. So it's confusing. I don't even know if I even make sense.


texts:
So I've finally delved into tuning up my aging Drupal 6 site using NewRelic and like most I'm amazed at what their product has to offer. Very useful for honing in on problem areas. However, being new to this I'm not fully sure what the correct actions are to fix my particular problem.

According to NR my biggest issue right now is the _revisioning_view (Revisioning Module) function. Digging through the trace reveals A LOT (1218) of calls to the url_alias table (which currently has 75,000+ records in it) I've read a few things suggesting running memcache or some form of Path Caching. 1218 Calls to url_alias certainly seems like a lot but before I go down the road of installing more modules I'd like to get a better grasp of what's going on here. Does anything jump out to anyone?

My other big item seems to be the time it takes to Insert and Update the cache_content table. See the attached screenshots from NR and let me know where you think I should go first.


texts:
I cannot change the temporary directory under file settings.  Everytime I change it, it says the changes have been made, but it reverts back to the setting it previously had.

I even went as far as deleting the 'dbo.variable.file_temporary_path' value in the database, but it is still not working.

Do you have an idea about where this is being stored?


texts: How to change the View Mode based on theme?

texts:
I am using the ThemeKey module to change the theme for mobile users. I have a custom View Mode called Mobile to display different content. I would like to have when my mobile theme is loaded for the node to use the Mobile View Mode that I created instead of the Default View Mode.

I would like to do this in the theme. Either hooking into the theme with a module or just placing the php in a template override.

Thanks!

Ok I found a few items that get my closer to what I am needing. I just can't seem to get it to work. I am testing this idea with the teaser for now.

<?php
$rendered_teaser = render(node_view(node_load($nid), 'teaser'));
?>

By using the node number I am able to get it to print in the page.tpl.php file fine. But I am wanting to get the node I am on and convert the view mode from full to teaser.

<?php
$rendered_teaser = render(node_view(node_load(2), 'teaser'));
?>

I found that information be reading the links below. I am still not able to get it to work but close. For some reason I get errors. I think it has to do with me placing it in the node.tpl.php and the page.tpl.php template file.

http://drupal.org/node/985022
http://drupal.stackexchange.com/questions/36028/getting-the-auto-summary-from-a-node-bodyhttp://drupal.stackexchange.com/questions/23961/print-result-of-a-node-load

And I got it working. Any comments appreciated. I placed this on the top of the page.tpl.php.

<?php
$nid = $node->nid;
if ($nid) {
 $nid = $node->nid;
 $rendered_view = node_view(node_load($nid), 'teaser');
}
?>

And I placed the print rendered_teaser where I wanted the node view to be printed.

<?php
if ($nid) {
 print render($rendered_view);
}
 else {
  print render($page['content']);
 }
?>


texts: How can I load a custom twig template depending on a view mode?

texts:
Currently I have the following code in my module file:
function mymodule_theme_suggestions_credit_report(array $variables) {
  return [
    'pdf_report__' . $variables['elements']['#view_mode']
  ];
}

function mymodule_theme($existing, $type, $theme, $path) {
  return [
    'pdf_report' => [
      'render element' => 'elements'
    ]
  ];
}

And I have inside /mymodule/templates/ 2 twig files

pdf-report.html.twig (just added the code from entity-html.twig)
pdf-report--new-style.html.twig

And I have a view mode in my pdf-report called new_style.
I've read documentation and it looks like this should work, but it doesn't.
I tried doing the following:
function mymodule_theme_suggestions_credit_report(array $variables) {
  return [
    'pdf_report__' . $variables['elements']['#view_mode']
  ];
}

function mymodule_theme($existing, $type, $theme, $path) {
  return [
    'pdf_report' => [
      'render element' => 'elements',
      'template'  => 'pdf-report--orcutt-style',
      'base hook' => 'pdf_report',
    ]
  ];
}

But this replaces all of the view modes, not just the one I want.


texts: What is the benefits of Panels for a themer?

texts:
I've never thought much of Panels, as I have always been comfortable with writing my own themes.

However, I have seen a lot of articles advocating the virtues of Panels (from Lullabot & Active Lamp), so I thought it would be time to revisit it, especially as Panels is going to be in Drupal 8.

I've played around with it extensively and I've even watched this helpful screen cast series.
But I can't see what the benefits are.

I usually build websites where non-technical people can edit the nodes.
Usually each node form will have several fields where the user can add all the content for that page.

To get the most out of Panels, it seems you have to split your pages into separate nodes that hold 1 piece of content and then use the Panels to bring the separate nodes together. This might be fine if you are creating a site that is only to be edited by a web designer.

However, it creates an issue when you give the site to a non technical person to add content. Most non-technical people would like to do all their page creation on a single screen. If they have to create lots of different nodes and then let Panels bring them altogether, it seems to be confusing for them.

I know Panels has better performance and better support for context compared to Blocks. However, it seems to add a lot of complexity and abstraction.

I can see how it would be incredibly useful for a non-themer, but I can't see what the benefits are for someone who can theme.

Could someone enlighten me. Thanks!


texts:
I have created two roles: Editor and Reviewer.

Editor must only create unpublished nodes; instead, Reviewer must publish and view these nodes.

How can I make users with a role see unpublished nodes? If I set the permission "Access the content overview page", the users with that role can modify all contents and I don't want this.

I tried the View unpublished module, but it has an issue, as reported in View unpublished breaks access rules defined by Views.

How to permit users to view unpublished nodes which they didn't create?


texts: How to create a fixed width image style for all landscape and portrait images?

texts:
I have an image style: Scale 580x580px.

When I upload a landscape image it gets a width of 580px.
When I upload e.g a portrait image with 809 (width) x 1100px (height) the width of the image (after image style is applied) on the page is 427 x 580px.

How do I manage the width is always 580px? So for all uploaded landscape and portrait images?


texts: I cannot delete Devel generated content because I get an error about a not existing table

texts:
I'm trying to delete some generated content but I get an unhandled exception in the log.

  Drupal\Core\Entity\EntityStorageException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.url_alias' doesn't exist: SELECT u.pid AS pid FROM {url_alias} u WHERE (source = :db_condition_placeholder_0) OR (source LIKE :db_condition_placeholder_1 ESCAPE '\'); Array ( [:db_condition_placeholder_0] => /node/178 [:db_condition_placeholder_1] => /node/178/% ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (line 794 of /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

The site is running on Drupal 8.8.0, and I installed the Pathauto module version 8.x-1.3.

How can I fix this issue?


texts: display only selected terms in custom node template

texts:
How can I change the below code to display only the selected terms in the node. right now all terms which are defined in the vocabulary is displayed

<?php
$items = taxonomy_vocabulary_machine_name_load('test_categories');
$taxonomy = taxonomy_get_tree($items->vid);
foreach($taxonomy as $key => $items):
  print $items->name;
endforeach;
?>


texts:
I am completely new to Drupal. And I would really appreciate if someone could help me out here.

I used the "WebForm" module, and created a form. The data went into the database perfectly fine, as it appears under the results page.

Lets assume that this is a "Contact Us" form, that looks like this

Name: _______

Subject: ________

Message: ______

3 labels, 3 input fields. Easy enough.

I am trying to create a table for all users to see.

Name        |    Subject            |  Message

user1       | Hello                 | Thank you for helping me out

user2       | Goodbye               | Drupal is great

If I were to use raw php, I would essentially be writing a SQL statement to Select all the data from the database, and use a For loop to generate these data into the table.

But how do I do this in Drupal? It seems impossible, and I cant seem to find 1 relevant documentation to generate this result.

Is there a webform extension that does this? Or am I expected to create a view to generate these data? If so, how?

Any help would be greatly appreciated.


texts: It is possible to use FAPI #states on hidden elements?

texts:
I want to enable a submit button based of a hidden input value. Right now i have this but it does not seem to work.

$states = array();
        $dependencies = array();
        foreach ($w_exercise->get($field_question_name) as $question){
            dpm('input_value-'.$question_bundle.'-'.$question->id->value());
            $dependencies[':input[name="input_value-'.$question_bundle.'-'.$question->id->value().'"]'] = array(
                '!value' => '0',
            );
        }
        $states['enabled'] = $dependencies;
        $form['exercise-footer']['exercise-footer-container']['op']['check'] = array(
            '#type' => 'submit',
            '#value' => t('Check'),
            '#validate' => array($validate_function),
            '#executes_submit_callback' => false,
            '#states' => $states,
        );


texts: Appropriate theme function for alter specific field for a view

texts:
I have used a view in my drupal.

In this view, I have used an "add to cart button" field.

In my theme, I am searching for a theme function in order to alter this field.
For example  want to remove css classes from this button and add another attributes to it.

what is the suitable theme_function in order to achieve this goal?


texts: How to build Druapl 7 bilingual website?

texts:
How I can build a bilingual version of my newly build website using Druapl 7.
I am using module Locale and entity_translation.When I clicking the arabic(my intention to support English,Arabic),that is not intending to RTL.
I have updated content type field  "Language" to "Language Neutral",how I can add the feature of bilingual in a manned which could change the language and indentation of each content?

Thanks in advance.


texts:
how to read all the nodes and its fields and display like table?

I have node/content caled TravelInvoice

Invoice Number
Invoice Date
Student Number
Months Paid (List Field) - Apr to March

some students may pay Apr only, some may pay Apr, May, Jun, some may pay full (Apr-Mar).
one student may pay Apr, Jun (in one Invoice), July, August, Sept (in another Invoice).

But when I check the pending fee for Apr.  It display the student too those already paid.

because each Invoice contain all the months (as list) and particular months only selecting for payment

how can I merge paid months from several TravelInvoices into one, so that I can verify easily from one content itself?

months are stored as List field

may be in the

first receipt  - Apr, Jun
second receipt - Jul, Aug, Sep, Oct
third receipt - Nov, Dec
so on...

I used Views Mege Fields for this..

but I get like the below...


texts: Use One Content type's field as a reference in another content type's view?

texts:
I have following requirements :

Add and List of Book
Add and List of Quiz related to book.

I have created content type for Book with field name : book_id,book_name,price etc..,here book_id will be unique in every time.

Also created content type for quiz with field name : quiz_name,my_book_id etc..

Now in view of quiz i have to show field quiz_name with book_name. How can it will be possible to map this field?

I refered too much like entity reference, node reference module etc but didnt get any solution.


texts: "basic page" content type: how would I restrict access to a page for only 1 role

texts:
If I created content that is of "basic page" content type that is mapped to a URL path settings as an alias how would I restrict access to that page to only 1 role?

If the user is not logged on then how can I redirect the user to a login page and then after that send them back page to the originally requested page?

Note I only want to restrict access for this one page and not all pages that have "basic page" content type.


texts: How to get new migrations to show up in the Migrate UI

texts:
My question is a general one: how do you get new migrations, which you've created via a custom module using Migrate, to show up in the Migrate UI at /admin/content/migrate ? What lines of code are necessary in your custom module for this?

Specifically, I'd like to know what's missing from a particular custom module (called ea_hub_migrations.module) that I've created. I created this by cutting down the migrate_example module, but after enabling ea_hub_migrations.module the migration group it defines isn't showing at /admin/content/migrate . By contrast, the migration I created with the module at https://drupal.org/node/1285276 does show up there. Here is the code for my custom module - I'd be very grateful if someone could take a look and tell me what's missing:

ea_hub_migrations.migrate.inc (included via ea_hub_migrations.info) - http://pastebin.com/KWMHd3gx


texts:
Trying to show locations world wide using GMap3 Tools module, however, any location over 4750 miles from default_center_lat and default_center_long are not rendered. Is there a fix? I have looked through the module code and see nothing.

$distance_meters = 4750 * 1609.34; //1 mile = 1609.34 meters

Any help understanding why I can't go over 4750 would be appreciated.


texts:
For a slideshow with banners, i've added the fields overlay-text and link-to. The link-to is the URL you go, if you click on the banner. It's al done & working in Views & Views Slideshow.

The user adds a node and has to set the URL by hand in the field link-to. Sometimes however, the banner has to point to a different URL or node.

How can i set the URL of the node when the field link-to is empty?


texts: How to programmatically print all comments from a given node?

texts:
I need to print comments belonging to a given node. So basically, get a node id then choose all the comments from a given node and print them. I know that I can print one comment (for example with id=12) using the following code:

<?php
$comment = _comment_load(12);
return theme('comment',$comment);
?>

Can anyone tell me how to do this?


texts: Show content that is tagged to both current node and translation source

texts:
I'm using Drupal 7, i18n, Views3, translated_entityreference, and Entity Translation.

http://lingtransoft.info/apps/paratext

I have a content type: Training Resource, and each Training Resource is a member of another content type that is connected connected by Entity Reference (field_translation_ref) to the content type Application.

If I add Training Resources in English and choose the application Paratext, they get tagged to node 174, the Original content. If I add a Training Resource in French and Choose the application Paratext, it gets connected to node 399985, the nid of the French translation of the Paratext content.

The following View allows me to see all Training Resources tagged to Paratext(174).

I know that the "Content Translation: Source Translation" Relationship is supposed to give me access to the source node, and "Content: Entity translation: translations" has the potential to allow access to the translated node, but I can't figure out how to configure the view to use these values.

What I want:

Now I would like a view that dynamically aggregates and displays the resources tagged to both Paratext(714) [The Translation Source] and Paratext(399985) [the translated node].

On the English Application page:
Show All Training Resources with Entity Reference to the current NID and also those connected to the Entity translation of this page in French.

On the French page:
Show All training Resources with entity reference to the current NID, and also those connected with the source Translation.

If possible, I would prefer to use the interface and/or some existing modules to do this.

Thanks for any help you can give me.
~Matthew


texts: token does not work in upload directory of webform

texts:
I'm using services module for generate json data , ve it's done in json data image data is inserted but i want to insert image url in json , how can i do this ?

Thanks for your helping


texts:
I am trying to create a menu structure on the user profile page like:

/user/%/content = Main tab (next to View, Edit) on /user/%uid
/user/%/content/published = Sub tab showing published nodes
/user/%/content/unpublished = Sub tab showing unpublished nodes

I have tried using /user/%/content/all as the main default tab.
Tried setting sub tab as default tab and not default.

Ive gotten:

    View, Edit, Published, Unpublished, My Content

    View, Edit, Published
                 -Published
                 -My Content

View, Edit, My Content (with no child tabs)

I can't seem to find the correct settings to get My Content to be the main tab, with Published and Unpublished to be sub tabs to My Content.

I tried swapping the settings for Published and My Content but that didn't work.

Does My Content need to be the default tab? Or does Publish need to be the default tab with My Content as the "parent already exists"?

Any help getting the tab structure sorted out would be greatly appreciated.


texts:
Howzit! I have a sandbox site set up, and one of my views overrides the default taxonomy term page for one of my vocabularies. The image below shows how it currently is (unstyled) - and this works just fine. The description of the manufacturer is embedded using Views Field View module, and I'm also using the Better Exposed Filters module.

Click for larger image

What I'm trying to do is separate the Sort By/Order form from the Category filter widget form as depicted in the Photoshop'd image below.

Click for larger image

My only experience with overriding tpl files has been minor theming/positioning stuff. So I overrode views-view.tpl.php and views-exposed-form.tpl.php, but the latter obviously just renders one form for exposed filters. Will sincerely appreciate your help with this.

FWIW, I'm using Devel and Theme Developer modules for the first time, and am completely lost with figuring out where the variables I'm looking for are, but I'll create another post for that if I'm still lost.


texts: Content edit submit handlers do not work for migrated content

texts:
I have my site in Drupal 7 and have successfully migrated all the contents to D9 (Can view them properly with all the custom fileds added to them. etc..)
There were a couple of original Drupal content types (like basic page and article) already there.
Now the problem:
When I try to preview or submit any original Drupal content types (article or basic page). everything goes fine and I can preview or submit the content.
However, if I try the same (edit and preview or submit) on any of my migrated contents, nothing happens. Page does not change
Incedently I see this error in the logs

Referrer  http://mysiteurl/node/preview/52687595-af84-4c53-85ff-3c1cd89747bf/full
Message     Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/history//read". in Drupal\Core\Routing\Router->matchRequest() (line 112 of /var/www/myrootdir/public_html/d9dev/core/lib/Drupal/Core/Routing/Router.php).

Are these things related?
How do I proceed to achieve the preview/submit ability on my migrated contents?


texts: How can I programmatically enable permission for anonymous users to view comments on a single node? Comments are open, but by default anonymous users are not allowed to view comments. I would like them to on one single node.


texts: Drupal commerce display VAT exclusive unit price & subtotal for line item in cart and order

texts:
I has a VAT tax for my products. It's a B2B site so we only show Tax exclusive price to customers. Even in cart and order. The VAT only show in the cart & order bottom just as the Drupal commerce original one.

My problem is I can not find a way to show the VAT exclusive price in the cart views. There is no option for that. The line item unit price field 'formatted amount' is showing VAT included price. 'formatted amount with components' is showing a price table like this:

Subtotal    $16.50 AUD
GST $1.65 AUD
Unit price  $18.15 AUD

That's not what I want. How can I only show the the price exclude the VAT tax?


texts:
I have an image field called field_image in a content type called Blog Post. I am able to use this field as expected, to upload and replace images, etc. I have a second content type called Event, where if I reuse this field, or even create a whole new Image field, I cannot upload an image. I get the following error in the console:

AjaxError:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /node/add/event?element_parents=field_image/widget/0&ajax_form=1
StatusText: OK
ResponseText:

Drupal.AjaxError.prototype = new Error();

I've tried clearing the caches but that doesn't make a difference.


texts: Add the field_data_field_void_delete table values with views_get_view()

texts:
In my project, I am using views_get_view() to get some values. It doesn't include the data of the field_data_field_void_delete table I required. I need to apply the field_void_delete_value = 0 filter to its data.

Is there any way to achieve this?

The code I am using is the following.

$myview = views_get_view('purchase_tracking');
$myview->set_display('block');
$myview->set_current_page($page);
$myview->set_items_per_page($limit);
$myview->set_arguments(array($person_id));
$myview->execute();
$table_data = $myview->result;
echo '<pre>';
print_r($table_data);
die;

I also need filtering the node table basing on the value of its status column; I want to get those rows where status is 1.

I added a pagination to the code. So adding the filtering in views function will get the correct output.


texts: Restricted access on reference field type?

texts:
I've created a new field in Drupal 8, the field type is an Entity Reference and the type of item is set to Field Storage.

When I edit my page, I select the node I want to reference, save and publish, but nothing shows on the page, when I go back into edit, the field it says:

  – Restricted access –  (node.field_field_name)

What's going on?


texts:
Let's say I have a Drupal 7 website, with 3 taxonomies and 3 articles.

 - Cars
   - Sport
     - Porshe
 - Family
   - Taurus
 - SUV
   - Navigator

No modules, no nothing, just this content and taxonomies.

Is is it a fairly simple process?