texts: Losing SSH access to Acquia Cloud: "permission denied (publickey)"

texts:
Sometimes, when working on an Acquia Cloud project, I seemingly spontaneously lose git access on the AC server. This might be related to switching between multiple workstations while working on the project. When I try to run a git command, I get

Permission denied (publickey).
fatal: Could not read from remote repository.

I have not changed my keys related to this project.


texts: Strange behavior of block display mode of views when the pager displays a specified number of items

texts:
I've encountered a problem that I've never seen that before (not even in my searches on google). for the sake of simplicity I explain it in an abstract model.
I have 4 content types with a title; they are named ct1, ct2, ct3, and ct4. Every content type has 4 nodes.

I made a view_N view for ctN, whose display mode is block. I allocated a block on the page p, and view_N must display the last 4 titles of ctN. I used the following settings.

Use pager: Display a specified number of items | 4 item
Offset : 0

Only view_1 displayed 4 items; the other views were empty. I changed "4 items" to 8, and view_1 and view_2 displayed output.

Finally, I found two solutions:

view_2's offset must be set to 4, view_3's offset must be set to 8, and view_4's offset must be set to 12.
I must set the number of items to display to 16

This is very strange because views and blocks must be totally independent but from what I saw these results are totally depend on each other. I think it is going to be very difficult to handle such independence when there are many blocks and views on the page and each one may have different number of outputs (or all the items).

Is there any general solution for it?

If that makes any difference, I am using Drupal 7.


texts: Drupal core patches with Commerce Kickstart 2.0

texts:
In the installation instructions for Commerce Kickstart 2.0, it alludes to the fact that Kickstart has two patches to the core.  See instructions at https://drupalcommerce.org/commerce-kickstart-2/install.

Did these patches make it into Drupal 7.34? I am asking because I don't want an install of Drupal core with Commerce Kickstart; I just want the Commerce Kickstart code without the core. I don't want to use the installer.


texts:
I have created a custom module in order to alter a webform that I created in the admin in drupal 8. I need to add ajax function to some fields. My problem is that I can not retrieve the field inside the hook_form_alter (even the title remains the same).
I paste below the function and what I ve tried so far:
function customvisit_form_alter(&$form, FormStateInterface $form_state, $form_id) {

$form['elements']['waiting_date_one']['#title'] = t('345');

$form['waiting_date_one'] = array(
        '#title' => t('Title'),
        '#description' => t('Description.'),
        '#weight' => 100,
        '#ajax' => [
    'callback' => '::myAjaxCallback',
    'disable-refocus' => FALSE, .
    'event' => 'change',
    'wrapper' => 'edit-output',
    'progress' => [
      'type' => 'throbber',
      'message' => t('Verifying entry...'),
    ],
  ]
    );
}


texts:
I need to get the previous (referrer) NID into a variable on a page. After saving new content of a certain content type a rule will redirect the visitor to a set page where I would like to have the NID of the new node to play with. Can anyone point me in the right direction? I think its possibly going to be one of those ones that you'd think is simple but ends up being awfully complex but I'm really in need of a solution and can't find anything very relevant.

Thanks in advance folks!


texts: Module name and name of the directory the containing it

texts: Google and stack has come up dry so far, so I'll ask you: In Drupal 8, does my module folder need to match the name of my module?  Some basic testing indicates that they can differ with no harm done, but Drupal 8 is still a bit of a black-box to me and I don't want to find myself painted into a corner because of this.


texts: How to programmatically delete a display from a view?

texts:
I am trying to programmatically delete an existing view’s display (at the same time as deleting a node) but I am not able to find the good implementation.

HOOK_node_delete(Drupal\Core\Entity\EntityInterface $node) {
//[…]
$view = Views::getView("VIEW_MACHINE_NAME");
$display_name = "block_1";
$views_display = $view->storage->getDisplay($display_name);
//[…]

I can access to the view’s display using the view entity (storage) but as the display has protected access I can’t delete it.

Any help?


texts: How to set permissions for cron for other roles (not administrators)

texts: Hello I need to set permissions for editor role. The editors need cron to send maillists/newsletters. How do I make cron available for them? It seems there is no way.


texts: How to fix the errors I get when migrating from WordPress 4?

texts:
On a fresh Drupal 8 installation, I installed the WP Migrate module. I downloaded a snapshot of the WordPress database on my local machine, edited the settings.php file, and added the following after the default database:

$databases['migrate']['default'] = array (
  'database' => 'mylocaldb',
  'username' => 'root',
  'password' => 'root',
  'prefix'  => 'myprefix_',
  'host' => '127.0.0.1',
  'port' => '8889',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

When I run drush migrate-manifest modules/migrate_wordpress/manifest_wordpress.yml --legacy-db-url=/Applications/MAMP/Library/bin/mysql://dbuser:dbpwd@127.0.0.1/dbname --legacy-db-prefix=mywpprefix_ -vvv, I get the following error:

  Undefined offset: 4 Database.php:212
  Undefined index: source NoSourcePluginDecorator.php:39
  Undefined index: driver Database.php:364
  Driver not specified for this database connection: migrate

On another Drupal 8 installation, I installed the WordPress Migrate module. While I was able to upload XML files, the module is still not ready and it does not migrate paths and categories.

How do I fix those errors?


texts: Is there any way to delete ubercart role expiration through rules in Drupal 7

texts:
I am using Drupal 7 and ubercart roles where I have given the role expiration period of 1 day,
and with that role the user can create one node.
I want that as soon as the new node is created the role expiration should be deleted.

I am able to remove the role through rules but as the expiration period is still set, it cannot be re-assigned the role the same role if the user purchases the same role again,

Is there any way to remove the role expiration of ubercart?

thanks for any help.


texts: Alter granularity in date exposed filter from Y-m to Y if only year is selected

texts:
I am trying desperately to get the following working:
Goal:
I have a views that displays a list of events. To this views is a date exposed filter attached, with granularity Y-m(year month). I want this filter to filter with Y granularity if only the year is selected, and by Y-m if both are selected.
In addition to that, the view is set so that: when no date filter is selected, then filter by upcoming events, else, use the exposed filter value
Issue:
The month is required, even if I alter the form
I am suprised by the fact that exposed_form_alter as well as the validation fct are called multiple times, before the view is pre-build and before it is pre-executed, but this might be normal behavior.
See here: http://cl.ly/image/1C0t3Z3O0D3W (hook_views_*** dpms the function's name)
Draft:
The solution was inspired by this thread
function lezoo_form_views_exposed_form_alter(&$form, &$form_state) {
  if($form['#id'] == 'views-exposed-form-teaser-list-panel-pane-1')
  {
   $form['#validate'][] = 'lezoo_views_exposed_form_validate';

  }
}

function lezoo_views_exposed_form_validate(&$form, &$form_state) {

  $handlers = &$form_state['input'];
  foreach ($handlers as $key => $handler) {
    if (
      isset($form[$key]['value']['#type'])
      && $form[$key]['value']['#type'] == 'date_select'
      && $form[$key]['value']['#date_format'] == 'Y-m'
      && $form_state['input'][$key]['value']['month'] == '') {
      $form[$key]['value']['#date_format'] == 'Y';
    unset($form[$key]['value']['#granularity'][2]);
    unset($form_state['input'][$key]['value']['month']);
  }
}
dpm('form validation');
   // dpm($form);
   // dpm('form_state');
   // dpm($form_state);
}

function lezoo_views_query_alter(&$view, &$query) {
  //If a date was selected in the exposed filter, ignore the default date filter '> today'
  $conditions = $view->query->where['1']['conditions'];
  $date_index = 3;
  if(isset($view->query->where['1']['conditions'][$date_index]) &&
    //if a date exposed filter was set
   $view->query->where['1']['conditions'][$date_index]['field'] != 'node.nid')
  {
    unset($view->query->where['1']['conditions'][2]);
  }
}

I am really stuck here, IRC is not helping unfortunately, and i would really appreciate more insights on this!
Thanks in advance!


texts: How can I make menus and submenus with links to the top 5 tags per section?

texts:
I'm trying to create a navigation structure with a main menu on the front page. Under each menu item there would be a link to the the top 5 tags used in that section. On clicking that section or one of the tags one would be taken to an article page where the list of tags for that entry would appear again - this time in full - in a side-bar.

Now, once the user is in a specific section I want any tag they add to their articles to be children of that specific section only. So for example if a use writes an article in the "book" section and adds the tag "thriller" his article should only appear under "books>>thriller" and not under "movies>>thriller".

Is this possible? Anyone has any tips on how I may do this?


texts:
I am getting the following error in Ajax Enabled View, which uses Load More Pager.

I am not sure if its, entirely because of OG, as the error doesn't appear in Views Preview but only in the actual view rendering in a page.


texts: Override view-list and get items properties

texts:
I'm currently working on Bartik theme and i'm trying to create a custom template for the Content-Recent block available in Drupal 8
For your information, i would like to create the following block view :

For that, I've followed these steps :

In Drupal 8 back-office, I've added the block view "Recent content" (Machine name : views_block__content_recent_block_1)
In my source code, I've created a new file in my templates folder and named : views-view-list--content-recent--block-1.html
I've added a static text : "Hello world", just to check if the template has been override, and it's OK for this part.

But now, I'm stuck because I don't know how to retrieve item properties (Title, Date, Description)
I've tried to find some informations with kint() and dump() but I'm bit lost :/


texts: How can I use exposed filter likes "views tree" in views of content?

texts:
I want to add exposed filter that shows taxonomy parents and children to views, this view's type is content.
Clearly my goal isn't creating menu by taxonomy, my goal is creating exposed filter for content of views.

Like Below.


texts:
I have an inherited Drupal 8 instance that has a nonstandard file configuration. Given then file/folder layout, I am pretty sure it is nearly impossible to run on Pantheon as is.

So - my last Hail Mary before dumping Pantheon and moving to something like Digital Ocean or better yet AWS is to at least get the package up and running via Docksal.

I'm just getting somewhat familiar with Docksal, so three questions;

1) Will it create a platform-agnostic environment on Pantheon that I can at least demo the Drupal 8 build.

2) If yes to #1, is there a step by step set of instructions on how-to-do that?

3) Can Docksal actually provide a way of creating a demo of the Drupal project externally without Pantheon (seems I read somewhere that it could).

Side note:  I've seen plenty of examples on how to pull down a Pantheon created instance into Docksal. Great - but does me no good. My instance was created outside of Pantheon and if Docksal is an alternative, I need to turn it into a Docksal image/container and somehow get that onto Pantheon.

Thanks in advance


texts: Error message getting displayed but not getting highlighted fields in Drupal 7

texts:
Drupal 7 is not displaying highlighted fields on using form_set_error but error message is getting displayed. I have rendered my form hook_form in template. Could that be the cause for this issue?

Here is my code:

if(($form_state['values']['field1']=='' ){
 form_set_error('', t('one field is required'));

 }


texts:
I have content type with a term reference field.  Let's call it 'Color'.  I want the content type to display markup depending on which term has been selected in the term reference field.  For example, if 'Color' is Red, then the markup field will display 'Red is the color of fire'.  If 'Color' is Purple, the markup field will display 'Purple is the color of royalty'.

Any ideas?

Thanks


texts: Is there a way to get faster dependent dropdowns?

texts:
I have a complex node form with a series of dependent dropdowns (pick option a, update choices for option b, pick b, update choices for option c, etc.).  It's all working fine with the standard ajax framework built into the Drupal form API.  But it's really, really slow - every ajax call causes every form field to be validated, the (complex) form_alter function is called twice, etc.

Is there a better way to decrease load time?

In my particular case, I don't need all of the overhead.  It's really easy to write a simple, speedy callback to validate selection a and generate the new set of options for b, and easy to update b on the form using normal, non-FAPI ajax.  But when the form is submitted, the selection for b does not validate (since the form knows nothing about the new set of options).  Is there a way to overcome that hurdle and feed the new options into the form without going through the FAPI ajax workflow?

Note that this is NOT a custom form, but is a node form being customized through a hook_form_alter .


texts: Subscribe all users to Simplenews Newsletter

texts:
We just installed Simplenews module. Is there a way to subscribe all our current users to one of the newsletters we created. This will be used to send important website updates. Therefore we don't want to skip users that have been registred to date.

We have a few thousands users, so a manual process will not work. Can this be done in the mysql database?


texts: How to render a Commerce pane programmatically?

texts:
I've the following code:

$panes = commerce_checkout_panes();
$payment_pane = $panes['commerce_payment'];

which loads one of Commerce pane which contains the array like:

array (size=15)
  'title' => string 'Payment' (length=7)
  'page' => string 'review' (length=6)
  'file' => string 'includes/commerce_payment.checkout_pane.inc' (length=43)
  'base' => string 'commerce_payment_pane' (length=21)
...

How do I render that pane programmatically?

This is part of commerce_checkout_form_review form (which is normally present at /checkout/%/review), but I need to render only payment part (checkboxes) but in different place.


texts: Correct way to link to views (to solve multi-domain problem)

texts:
I have one site (same codebase, same database) that uses two different domains to display two different themes, depending on the content. (This is achieved via the Domain Access module.)

I need to be able to link from one domain to a view on another domain without manually inserting the absolute URL, but I'm not sure how (or even if it's possible).*

I can use l() to link to nodes without any problems. For example, if I'm on first-domain.com and I want to link to second-domain.com/news-story, I would do the following:

<?php print l('News Story', 'node/2213'); ?>

I don't know exactly how it works, but it realises that the news story isn't available on the first domain and automatically creates the absolute link to the second domain.

Creating a link to a view doesn't seem to be so easy. I've made sure the view's Access restrictions is set to Domains (and that only the one domain is selected) but the l() function doesn't seem to look this up.

For example, if I'm on first-domain.com and want to link to a list of all the news stories (which is created by a view) on second-domain.com, doing this:

<?php print l('Latest News Stories', 'news-stories'); ?>

Results in a link like this:

first-domain.com/news-stories

When I really want: second-domain.com/news-stories

Is there any way to solve this? Even if I could look up both domains that have been set via the Domain Access module would work, but I don't know how to do that either. (I've also thought about using Path Redirect, which is better than nothing, but not quite what I'm looking for.)

* Obviously it's possible to put in an absolute URL, but this is far from ideal as the site is currently being developed locally and will eventually be moved to a staging site, and then moved again to production once ready. Remembering to change the absolute links every time would be annoying at best.


texts: how to add a terms to a vocabulary by form?

texts:
I'm using drupal 7
I need to create a form that can add new terms to specific vocabulary.
Which function can do that?
Thanks


texts: How can I display the value of an addressfield in a single line?

texts:
I modified the "Address form (country-specific)" bundled with the Addressfield module to take only a country, administrative area, and city; this works fine on the node edit form, but when the field is displayed upon viewing the node, it looks like this:

What I want to do is display it on a single line with commas like this:

  Indianapolis, Indiana, United States

I am using the Views module to display the field.  How can I rewrite (using Views or custom code) the addressfield output to be a single line?


texts: Ajax field sometimes loses value on form submit

texts:
I have a Drupal 8 form with several fields that update a price via Ajax.

One of the fields is failing to a textbox, that does a callback on the blur event. It looks like this:

$form['free_amount'] = array(
  '#type' => 'number',
  '#title' => $config->get('add_on_free.label'),
  '#description' => $config->get('add_on_free.description'),
  '#default_value' => '0',
  '#min' => 0,
  '#ajax' => array(
    'callback' => $callback,
    'event' => 'blur',
    'target' => $id,
  ),
);

$form['payment']['price']['total_price'] = array(
  '#prefix' => '
',
  '#suffix' => '
',
  '#markup' => $this->t('Total amount to pay: @symbol@total',
               ['@symbol' => $symbol, '@total' => $totalPrice]),
);

The ajax callback looks like this:

public function updateMemberPriceCallback(array $form, FormStateInterface $form_state) {
  $ajax_response = new AjaxResponse();
  $ajax_response->addCommand(new HtmlCommand('#Pricing', $form['payment']['price']));

  return $ajax_response;
}

The problem I'm having is that sometimes when the form submits, the free_amount field has no value. It doesn't always happen, and I haven't figured out a pattern that causes it. I thought it might be if the blur event didn't occur before submitting the form, but that doesn't seem to be it. I can't see a clear pattern to when it occurs.

If I take the Ajax update off the field, it always submits correctly, but the total doesn't update before the form submits.

Is there a way I can make this work reliably?

Thanks for your help,

James


texts:
I'm using small jQuery script to change src argument on img tag. It works without any problems on my hosting but after migrating website on client's hosting this script doesn't work at all.

I have checked with Firebug and the script is there. I also tried to access to [website]/misc/ui/jquery.ui.core.min.js in browser and jQuery is shown. I tried to install jquery_update module and change versions of jQuery (with and without CDN). None of this helped.

I noticed on 'Status report' page warning because of PHP mbstring extension.

Is this could be the possible reason for not working?

In Firebug my script shows like:

<script><![CDATA[
]]><!--//--><![CDATA[// ><!--

jQuery(document).ready(function() {
    var img;
        img = '/sites/all/themes/ave/img/logo2.png';
        jQuery('.logo-img a img').attr("src", img);
    });

//--><!]]><![CDATA[
]]></script>

Do you have some ideas or maybe similar experience?


texts: Users' list view based on current logged in user taxonomy field value

texts:
I'm on drupal 7, with views 3.5.

I have added to the user profile, a taxonomy field.

I want to create a view, which will get the users which that taxonomy field has the same value with the current logged in user taxonomy field value.

Is it possible?


texts: Randomly show one item from the last x posted

texts: I have worked out how to select a random item - add a sort criteria of type Global: Random. I can also select from, say, the last month, by adding a filter. However, if I want to select randomly from the last, say, 5 items posted, I can't find a way to do that.


texts: Get value of field attached to the file entity in a view

texts: I extended the file entity of type video, which ships with the media/file_entity module, with an extra field "tags". How can i get the values of this attached field in views?


texts: What are the advantages, for managing a single multisite instance of Drupal, to using drush make instead of git fetch & merge?

texts: I don't intend to publicly distribute an installation profile for my multisite instance. Are there still advantages to using platform/site makefiles to move code updates through dev/test/production environments compared to the alternative of pulling changes from either a platform repository (for cross-site changes) or a site repository (for site-specific changes)?


texts: Drupal 8 - some child pages are not visible on particular book using view

texts:
I would like to ask for your help as I'm having a trouble in displaying some child pages of a particular Book in Drupal 8 using view. There's a book which displayed all the child pages but there's some book which displayed incomplete child pages and some book, doesn't display the child pages at all.

I created two views, one for the list of all top level book and the other one is for the child pages.

Here's what I have done on view settings:

to display the list of book:

Format: Unformatted list
Show: Fields
Filter Criteria:
  Content Published (=Yes)
  Content: Content type (= Services)
  Book: Depth (= 1)
Sort Criteria: Content: Title (asc)

to display the child pages:

Format: Unformatted list
Show: Fields
Filter Criteria: Content Published (=Yes)
Sort Criteria: Content: Title (asc)
Contextual Filters: (Book Parent) Content: ID
Relationships: Book Parent
Configure Relationship: Book Parent : Required this Relationship

After saving it, I added this to the block layout.

I'm not sure what went wrong on my settings.

Thank you in advance for you help!


texts: How do I remove the tab provided by a third-party module?

texts: I'm using the Guestbook module version 6x-2.0. How do I remove the "My Guestbook" tab on user profile pages?


texts: Open Atrium 2: comment forms not appearing on pages

texts:
Situation:

Recently created a fresh Open Atrium 2 installation to replace an old AO1.
No content from the old OA1 database has been migrated, we're making a fresh start. Some content (a few pages) will be recreated by copy-pasting the content.
No anonymous access allowed, only authenticated users have acces to any content. Only admins can create user accounts.
As of yet, no groups and teams have been made -- there's only a handful of users. The actual userbase will be small enough that it can be managed simply by giving individuals access to certain spaces; groups and teams may be made later if the need arises. (I'm still partially in OA1 mode, really :) )

Problem: Comment forms do not appear anywhere in the site, for any user level (authenticated, editor, admin).

I have:

checked whether the required comment modules are enabled (they are)
checked permissions; authenticated users can view & post comments, skip approval & edit their own comments
made sure commenting is enabled for that content type (it is by default, no settings changed there)
made sure it's not simply a matter of permissions not being retroactive. Newly created content still has the same problem, though.
checked individual nodes (in this case, calendar events) to make sure comments are open
spent several hours googling, but found nothing beyond the things I've already tried.

Most likely I'm simply overlooking one little setting somewhere, but right now this has me stumped... Any pointers would be highly appreciated.


texts:
I received an error from the Notify Module when attempting to "truncate" the queue.

The error was:

Warning: Invalid argument supplied for foreach() in notify_admin_queue_submit() (line 956 of /var/www/html/sites/all/modules/notify/notify.module).

Essentially, the queue was not cleared because of this.

Any ideas?


texts: Single sign-on between different versions

texts:
I have two websites one in Drupal 7 and other in Drupal 8. I want to implement single sign-on between these two websites.

My users are registered in Drupal 7 and I want my users authenticated from there to use Drupal 8 website. What is the feasible solution for this?


texts:
Class Documentation: SettingsCommand

I'm trying to figure out how to use this Ajax Command correctly. I must be confused from the documentation, so I'm hoping someone can shed some light where I'm mistaken.

__construct(array $settings, $merge = FALSE)

  array $settings: An array of key/value pairs of JavaScript settings.
  bool $merge: Whether the settings should be merged into the global drupalSettings.

Given the array already in drupalSettings: ['drupalSettings']['myData'] = [1,2,3,4,5];
And the following ajaxCallback I would like to replace the 'myData' array with [2, 4]:

    namespace Drupal\settings_controller_test\Form;

    use Drupal\Core\Form\FormBase;
    use Drupal\Core\Form\FormStateInterface;
    use Drupal\Core\Ajax\AjaxResponse;
    use Drupal\Core\Ajax\SettingsCommand;

    class SettingsControllerTestForm extends FormBase
    {
        public function getFormId() { return 'settings_controller_test_form'; }

        public function buildForm(array $form, FormStateInterface $form_state)
        {
            $form['invoker'] = [
                '#type' => 'submit',
                '#value' => t('Invoke Callback'),
                '#ajax' => [
                    'callback' => [$this, 'ajaxCallback']
                    ]
                ];

            $form['#attached']['drupalSettings']['myData'] = [1,2,3,4,5];
            $form['#attached']['library'][] = 'settings_controller_test/test';
            return $form;
        }

        public function ajaxCallback(array &$form, FormStateInterface $form_state)
        {
            $response = new AjaxResponse();

            #clear old myData settings
            $response->addCommand(new SettingsCommand(['myData' => []], TRUE));

            #add new data for myData settings
            $response->addCommand(new SettingsCommand(['myData' => [2,4]], TRUE));

            return $response;
        }

        public function validateForm(array &$form, FormStateInterface $form_state){}
        public function submitForm(array &$form, FormStateInterface $form_state){}
    }

I'm testing the state of 'myData' in JavaScript using the following:

(function ($, Drupal, drupalSettings) {
    Drupal.behaviors.myBehaviour = {
      attach: function (context) {
        //output: [1, 2, 3, 4, 5]
        console.log(drupalSettings.myData);

        $(document).once().ajaxComplete(function(event, xhr, settings) {
          //output: [2, 4, 3, 4, 5]
          console.log(drupalSettings.myData);
        });

      }
    };
  })(jQuery, Drupal, drupalSettings);

UPDATE: The attempt to clear the myData array fails. Then when I attempt to set myData = [2,4] with merge set as TRUE the leading two elements change to 2,4 and the remaining elements in the array are still there.
NOTE: If I change: $response->addCommand(new SettingsCommand(['myData' => [2,4]], TRUE)); to $response->addCommand(new SettingsCommand(['myData' => [2,4]], FALSE)); the myData array remains completely unchanged [1,2,3,4,5]


texts: Sorting Content easily - wish to avoid a "weight" integer

texts:
As the title describes, I want to create a mechanism with which a bunch of Content Types can be sorted 'easily' so they can be presented with a View according to that sorting.

Adding an Integer that would act as 'weight' should work but can end up being confusing if the number of nodes get's too high.

Ideally some sort of 'tablesorting' would be sweet.

Is there a way to accomplish such a thing?

Thanks in advance.


texts:
I have a node form with some fields, now I want to append some more fields to it on an ajax callback. in the ajax page I have rendered the new form elements with drupal_render function
My problem is that I am not getting the newly built form fields in POST or form_state.
Shall I use AHAH or can I continue with this ajax calls?

$form['country'] = array(
            "#type"=>"select",
            '#title'    =>t('Ship To'),
            '#required' => true ,
            '#options' => $options,
            '#weight' =>10,
            '#attributes' =>  array('id' => $cn_var),
        );
        $form['dyn_cost'] = array(
            "#type"=>"textfield",
            '#title'    =>t('Shipping Cost'),
            '#required' => true ,
            '#size' =>25,
            '#weight' =>11,
            '#id' =>  $co_var,
        );

        print drupal_render($form);
        exit;

This is my ajax form and it is supposed to be appending to the node form.


texts: Create content of certain content type based on outside information/validation

texts:
I'm running a game server. This server is updated ever so often and I want my players to be informed about the update.

I want this to happen automatically. What I have is some JSON output I can query for changes to the version of the server. If there is a valid response (an update occurred) I want to create an article on my website.

Can articles be created based on outside check and subsequently be filled with some data from these JSON responses?


texts:
I'm having a bit of a hard time with Drupal 8.

I've created a custom theme and am trying to override twig files. I've got debugging enabled so I know which files to copy to my template directory. However, when I copy a twig template it outputs nothing.

For example, I'm trying to wrap the site title in an H1 element. The core template file used in this case is /core/themes/stable/templates/block/block--system-branding-block.html.twig. If I add the H1 element in that file the header is inside a H1 element, but when I copy the twig file to my template directory the whole header is gone.

I can see in the source code that the file was found:

<!--  BEGIN OUTPUT from 'themes/mytheme/block--system-branding-block.html.twig' -->
<!--  END OUTPUT from 'themes/mytheme/block--system-branding-block.html.twig' -->

The documentation suggests that copying the relevant twig file is all that's needed but maybe I'm missing something? And if this should work, how can I debug this issue (the Apache error log doesn't report any errors).


texts: How do I create a filter based on the current user's role in a search_api based view?

texts:
I would like to filter a search_api based view using the current user's roles as input.
I don't see a contextual filter for the current user in my search_api based content view at all.
How can I accomplish something like the "Published or has role" feature of this contrib module? This one seems to only work on non-search_api views.


texts: How to set headers in REST API endpoints for GET method?

texts:
I am writing Rest api end point for GET method and testing the same in postman client. By default there is no Header for encoding technique called utf-8. I want to send it in Response headers manually. So I tried like below:

$response = new ResourceResponse($newsfeed, 200);
$response->headers->set('charset', 'utf-8');

After this I got this in postman Headers like :Charset: utf-8.

I am just wondering is this right way to set or is there any alternative efficient way to handle it? Can anyone help me on this?


texts:
I'm just looking for a module in drupal to make a shopping cart customizable. I mean that there will be no products, I just need that people put the amount of money they need to pay and just click proceed to checkout and goes directly to the payment gateway with the amount written. I've been looking to Commerce and Ubercart but I couldn't figure out if there is this option.
Can you help?


texts: Ubercart Recurring Payments and Subscriptions:Charge automatically?

texts:
I'm using Drupal 6 and Ubercart 6.x-2.7.
In my online store I'm going to manage subscription for the products. Every product can be subscribed for some period of time, weekly, biweekly, monthly, semiannually. I'm going to use PayPal PayFlow Pro and PayPal Website Payments Pro gateways to receive payments.

The issue is here how to manage getting recurring payments through this payment gateways? Any php code or something else?

Here I'm including how this process works:

Customer adds required products in his shopping cart.
In the cart there is a select-box per every product for subscription(options: just one time, daily, weekly...)
Customer checks out from the site paying with Credit/Debit card or PayPal account.

Question: How to charge automatically the fee for subscription in the selected period?


texts:
I am using these modules:

https://www.drupal.org/project/search_api_solr
https://www.drupal.org/project/search_api_solr_multilingual

Solr is version 4.5.1.

It has issue with Chinese words and partial search.

When the search term is 台湾东部岸外海域 发生5.7级地震, it works; a partial search for 台湾东部 doesn't work. If there are two words, it will search with the start point of each word; if it takes some of the characters of that word, it fails.

How can I fix this problem?


texts: Prevent Field From Updating On Follow Up Saves?

texts:
Use Case:

On Page A (Content Type A), there is a select list with options A and B

1st Rule for Choice A

User selects A, and a field "Date You Chose Letter" (a date field) captures the current DateTime.

2nd Rule for Choice B

User selects B, and the same field "Date You Chose Letter" (a date field) captures the current DateTime.

Easy enough.

But, when the User returns to Page A, makes some changes (and assume "A" is still selected) the 1st Rule triggers again, updating the "Date You Chose Letter" field with a new current Date/Time

The goal:  Do not update the "Date You Chose Letter" field after the initial selection. So I need to set in stone.


texts: display link after finishing coutdown time

texts: I am using Jquery Countdown module. In this, user can display text message after completing countdown. But I want to display a link after completing countdown.


texts:
I've installed Poll Core module in Drupal 7 trying to display the same poll with the same result in two languages (English and Arabic) but Drupal treats each one as a separate poll with different result ...

How could I do this?

Is there any other module can handle this?

I've tried Advanced Poll but I cannot use it I do not know how?


texts: Menu does not translate on second language

texts:
I have a multi language Drupal 8 site. But when I change the language of the Drupal site to the second language everything changes to the selected language except the main menu.

When I change the language when I'm logged in, the main menu will be translated to the selected language.

Can someone help me to make the menu change language when a normal user select his preferenced language?


texts:
Im currently using Drupal's http client manager module to pull data from a json endpoint. I am having trouble getting this to work for a nested structure like this.
{
  count: 2431
  page_info: []
  content:
    0:
      id: 1
      title: "Ipsum lorem"
    1:
      id: 2
      title: "dolor set"
}

The service description looks like this.
operations:
  GetEvents:
    httpMethod: "GET"
    uri: "8892e8de"
    summary: "Gets the available Posts."
    responseClass: "PostsList"

models:
  Posts:
    type: "object"
    location: "json"
    properties:
      content:
        location: "json"
        type: "array"

  PostsList:
    type: "array"
    location: "json"
    items:
      "$ref": "Posts"

This is returning an empty object of arrays and not picking up any data.
How can I access the nested data?


texts: Programatically setting ratings with Fivestar/Voting API (Drupal 7)

texts: I am working on redoing a site with Drupal 7 and the old site has a rating system and I would like to be able to import the old ratings along with the project.  Currently all I have access to is the number of votes and the total score.  Is there anyway to coerce a Fivestar with just these two number or would I also need access to a table showing who voted and when?


texts: fields with Image styles only showing placeholder

texts:
I've got some images that's set to be shown in specific image styles. They appear fine on each node but in teasers and views I only get a placeholder.

The console in Chrome's inspector says:

  Failed to load resource: the server responded with a status of 500 (Internal Server Error)

The Files folder has permissions set to 775. Should be good, right?

Any ideas?


texts:
I am including a template file from hook_theme.

function my_module_theme() {

  return array(
    'my_entity' => array(
      'variables' => array('title' => NULL, 'body' => NULL),
      'path' => drupal_get_path('module', 'my_module') . '/templates',
      'template' => 'my_entity'
    ),
  );
}

this is the code and i don't know why control is not going in template file.
Note:- Cache flushed.


texts: How to enable ckeditor in the emails templates at admin/config/people/accounts?

texts:
Just that.

I need to enable ckeditor to write the text body for the welcome e-mail message at admin/config/people/accounts

How can I do this?


texts: get path of uploaded picture for custom parallax effect

texts:
i created a custom block where i can upload an image. i overwrite the custom block with a template:

  {{ title_prefix }}
  {% if label %}

{{ label }}

  {% endif %}
  {{ title_suffix }}
  {% block content %}

          {{content.field_parallax_bilder }}  <----- (1)

  <----- (2)

  {% endblock %}

i want to get the path of the image (1) and include it in my data-image-src parameter (2). is there an easier way then write a block_preprocess?


texts: How can I show average votes of fivestar nodes?

texts:
I want to make a survey with Drupal, using Fivestar fields. So, I created a new content type called "survey" and added fields "field1, field2, field3, ..." The user can add content "survey" and the results of the voting are saved in nodes.

Now, I want show an average for all nodes with the content type "survey": Display the average of the individual fields of the survey. How can I do it?


texts: How can I show a flag link only for the "deepest" terms for a field with multiple values using hierarchical select?

texts:
On my site, users can add terms to their user profiles via a taxonomy field.  They can add multiple terms with multiple depths using the hierarchical select widget, like this:

Trees -> Fruit trees -> Apple trees
CMS Software -> Drupal

These terms are displayed on the user profile page using a view with the hierarchical select formatter.

I have a flag that allows users to flag taxonomy terms. I want to print a flag link after the last term on each line, like this:

Trees -> Fruit trees -> Apple trees (flag me)
CMS Software -> Drupal (flag me)

The code for this is in hierarchical_select/modules/hs_taxonomy.module:

function theme_hs_taxonomy_formatter_lineage($variables) {
  $output = '';
  $lineage = $variables['lineage'];
  $separator = theme('hierarchical_select_item_separator');

  // Render each item within a lineage.
  $items = array();
  foreach ($lineage as $level => $item ) {
    dpm($item);
    $line  = '';
    $line .= drupal_render($item);
    //this adds a flag link to every term, not just the last term
    $line .= flag_create_link('hobbies_and_interests', $item['#options']['entity']->tid);

    $line .= '';
    $items[] = $line;
  }
  $output .= implode($separator, $items);
  return $output;
}

As I commented in the code above, currently I am showing a flag link for every term, not the last term in each row. This output (which I don't want) looks like this:

Trees (flag me) -> Fruit trees (flag me) -> Apple trees (flag me)
CMS Software (flag me) -> Drupal (flag me)

This is ugly; I just want the "flag me" link to appear at the end for the final term in each line.  However, I don't know how to target only the last term in each row.  I tried using end() but $output appears to be a string, not an array, so I'm lost at how to proceed (the answer may be obvious, but I'm a PHP novice).


texts:
Hi Drupal enthusiasts!

I am trying to design way of organizing FAQ on Drupal page.

Does anyone know about module that implements following use case?

2 vocabularies: faq categories, faq items grouping.

Example:

Faq Categories:

Application

Calculator

Paint

Notepad

Faq Grouping:

Using cursor
Printing
Saving

Now I create question, I may choose Paint and Notepad tags for categories, to show a question in both categories. Then I choose printing term to show this question next to other one, which is also printing group.

Do you think I should struggle with Views? I don't think it's gonna fulfil following use case. Probably I need to write code by myself.. Question can be assigned to as many grouping and category terms as wanted, as some questions are referring to multiple..


texts: Add Attachment to Rules Email - Drupal 8

texts:
I am trying to set up a simple rule in D8 that when a new node is created, an email is sent out that includes an attachment from the file system.

How can I accomplish this?


texts: How can we configure the Master slave concept for moving field data to slave database?

texts:
How can we use drupal master slave setting to push field data into slave database and starts using field data from slave database?

Is it even possible with drupal 7?


texts: Wordpress Migrate Inline Images looking in wrong folder

texts: I've recently used the Wordpress Migration module to bring over a lot of posts into drupal. The images get moved, and the text comes in fine. The problem is when the images get brought over they are put in one location on the server, but the inline media tags tell them to use view_mode: media_large the images don't show in the post because it's looking in the '/sites/default/files/styles/large/public' folder instead of where they actually got imported to. How do I either import these posts so that the images go there, or so that the media tags that are created don't look in the large folder but where the files actually are?


texts: Unable to login as user in my drupal 6.x website while able to access without login

texts:
I am having a strange problem with my drupal website where site is working and anybody is able to surf it properly however the moment I try to login using my admin or account it shows offline message given below. What could be the reason

+++++++++++++
Site off-line

The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.

If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider's database server is running. For more help, see the handbook, or contact your hosting provider.


texts: I would like to add an additional field to block's edit screen and be able to retrieve it's value upon rendering. Is it possible?


texts: User Badges module not respecting 'change own badge assignments' permission

texts:
For version 7.x-4.x-dev, users who have 'change badge assignments' permission but not 'change own badge assignments' can still view the Badges tab and edit the badges in their own user profiles in the User Badges module.

I have also created an issue here.

Note: the same issue seems to exist in the 7.x-3.x version.


texts: How to expose the node creation form in the front page?

texts:
I created a new content type "project" and I want to create a view where every one can add a node (create a content) with my content type.

How to expose the form (to add a new project node) in the front (I do not just want to expose a link to add such node)?

In admin/people/permissions I granted the permission for ANONYMOUS USER to be able to create a new content.


texts: How can we just apply the updates to a single module using composer without apply patches for other modules?

texts:
We have the following composer.json file. When we want to update a module such as  Environment Indicator, we run the suggested composer command composer require drupal/environment_indicator:^3.7'.

In doing so it also applies the patches for core and other modules because the patches is defined in our composer.json file.

What we tried this as well but it had the same results.

composer update drupal/environment_indicator --with-dependencies

composer.json

{
    "name": "drupal/drupal",
    "description": "Drupal is an open source content management platform powering millions of websites and applications.",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "require": {
        "composer/installers": "^1.0.24",
        "drupal/core" : "^8.6",
        "wikimedia/composer-merge-plugin": "^1.4"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8"
    },
    "extra": {
        "_readme": [
            "By default Drupal loads the autoloader from ./vendor/autoload.php.",
            "To change the autoloader you can edit ./autoload.php.",
            "This file specifies the packages.drupal.org repository.",
            "You can read more about this composer repository at:",
            "https://www.drupal.org/node/2718229"
        ],
        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],
            "recurse": true,
            "replace": false,
            "merge-extra": false
        },
        "installer-paths": {
            "core": ["type:drupal-core"],
            "modules/contrib/{$name}": ["type:drupal-module"],
            "profiles/contrib/{$name}": ["type:drupal-profile"],
            "themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/contrib/{$name}": ["type:drupal-drush"],
            "modules/custom/{$name}": ["type:drupal-custom-module"],
            "themes/custom/{$name}": ["type:drupal-custom-theme"]
        },
        "enable-patching": true,
        "patches" : {
            "drupal/core": {
               "issuenumber1" : "path/to/patch.patch",
             },
            "drupal/eck": {
               "issuenumber2" : "path/to/patch.patch",
             },
        }
    },
}


texts: Send HTML email to all users of a role in action not display .....help me please

texts:
Send HTML email to all users of a role in action not display ;
only send HTML-email display
help me please.


texts: How to automatically generate a table of contents for a list of nodes?

texts:
I want to generate a table of contents made up of the titles of the nodes listed within a view, which will then be displayed at the top of that view. The nodes are of just one content type.

I've spent the last couple of days looking through the pre-existing modules, but thus far they all seem to generate TOCs only for one particular node.

Can anyone point me in the correct direction?


texts: Remove webform field while edit webform submission

texts: I have one webform and need to do that there are 2 fields, TL approval and Manager approval, now if manager submission page will edit by admin then TL approval field should not be load, in short i want to remove specific fields role wise when webform submission will edit. If anyone have an idea about this then let me know.


texts: Webfrom : Having two textfield boxes inline .

texts:
What I need to do is have two input boxes next to each other.  As it's to except data that comes in two parts.  I can do this with CSS but using inline errors causes me problems. Has anyone done this or have any ideas on a solution.

Drupal 7 - webfrom 7.x-4.9+2-dev


texts:
I have implemented a new entity type that requires paged access to DB and meet a probem with several pagers for independent entities on the same theme page.

The problem is that that entity can be used along with the node, thus two (or more) pagers may co-exist on the same page. The element property of PagerDefault apparently does not work (see discussion). In addition, PagerDefault simply uses $_GET['page']) to find required page number, which leads to even bigger confusion - both absolutely independed DB queries share same HTTP page query parameter.

What do you believe is good solution of this problem?

Further investigations have revealed a bug with EntityFieldQuery::pager()


texts:
I want to modify my register page and add some fields from 'profile' content, for example: gender.

So Ive got:

function mysite_preprocess_user_register(&$variables) {
   unset ($variables['form']['Personal Information']['profile_gender']['#description'] );
   ....
}

In this point when i print_r profile_gender Ive got:

Array ( [#type] => select [#title] => Gender [#default_value] => [#options] => Array ( [0] => -- [Select] => Select [Male] => Male [Female] => Female ) [#required] => 0 [#post] => Array ( ) [#programmed] => [#tree] => [#parents] => Array ( [0] => profile_gender ) [#array_parents] => Array ( [0] => Personal Information [1] => profile_gender ) [#weight] => 0.003 [#processed] => 1 [#attributes] => Array ( ) [#input] => 1 [#size] => 0 [#multiple] => [#process] => Array ( [0] => form_expand_ahah ) [#name] => profile_gender [#id] => edit-profile-gender [#value] => [#defaults_loaded] => 1 [#sorted] => 1 )

And when I want to change #type to 'radios' displays me nothing..

Like:

  $variables['form']['Personal Information']['profile_gender']['#type'] = 'radios';
  $variables['form']['Personal Information']['profile_gender']['#options'] = array('0'=>t('Male'),'1'=>t('Female'));
  $variables['form']['Personal Information']['profile_gender']['#default_value'] = 'Male';

    $variables['gender'] = drupal_render($variables['form']['Personal Information']['profile_gender']);

Any ideas how to change that from select list to radios(male/female)?


texts: modules_install hook causes constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module)

texts:
I am trying to set several permissions when a feature is being enabled (a new content type).
By default this content type is disabled, and an admin can go to structure/features and enable it

under docroot/profile/my_profile/features/foo I created the following foo.install file

function foo_modules_installed($modules) {
 if (in_array('foo', $modules)) {
  $perms = array(
    'create foo content',
    'edit own foo content',
    );
      user_role_grant_permissions(user_role_load_by_name('publisher')->rid, $perms);
      user_role_grant_permissions(user_role_load_by_name('administrator')->rid, $perms);
}
}

but when I go to structure/features and enable it, I get the following error

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module

I tried different hooks, like enabled and so forth and all have the same issue.

How can I have a feature disabled by default, but still grant permissions to some users? What am I doing wrong


texts: Pager not rendering in custom twig template

texts:
I have custom twig template for product listing

Below is my code in controller

$query = \Drupal::entityQuery('node')
->condition('status', 1)
->condition('type', 'product')
->pager(1)
->sort('created', 'DESC');

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

pager_default_initialize($query->total, '1');

$list = array();
$path = base_path();
foreach ($nodes AS $node){

    $nid = $node->get('nid')->value;
    $list[$nid]['title'] = $node->get('title')->value;
    $list[$nid]['image'] = str_replace('public://', $base_url . '/sites/default/files/', $node->get('field_product_image')->entity->getFileuri());
    $list[$nid]['desc'] = $node->body->value;
}

$build['result'] = array(
'#theme' => 'list_product',
'#items' => $list,
'#path'  => $path,
   '#pager' => array(
        '#type' => 'pager',
    ),
 );

 return $build;

Here is my twig file code

  {% for item in items %}

            {{ item.title }}

            {{ item.desc|raw }}

  {% endfor %}

{{ pager }}

Still pager is not getting rendered.

Note: The examples in How to add Pager to a custom page? tell you how you can set pager and return it, I need a solution to render it in my list.html.twig template.


texts: Can't get Jcarousel to work, followed the instructions

texts:
This what I have done:

Get Jcarousel module and install.
Got Jcarousel Pluggin zipped files
Created sites/all/libraries/jquery.jcarousel folder
Moved the content of the downloaded folder into the sites/all/libraries/jquery.jcarousel     folder

Now this is where there is a problem:

  When this is done there should be a file
  sites/all/libraries/jquery.jcarousel/lib/jquery.jcarousel.js or
  jquery.jcarousel.min.js

There is no such file there. Where do I get those files? I've tried to copy and paste the files from folder:

sites\all\libraries\jquery.jcarousel\dist

Not working.

What am I missing? Where do I get the files :

jquery.jcarousel.js

jquery.jcarousel.min.js


texts:
Views require "Use AJAX" in order to display exposed filters when using Block display. I think this is necessary to avoid submitting/influencing other form elements on the current page.

I have a page that is a View but my page has to have a certain route name because my app relies on it. So I've used Block display for the Views instead of the Page display.

But I want the user to see the filtering arguments in URL so he can save the search or link to it. So obviously I will have to use the Page display for my view. But how can I use the Views with mine route?

Is is a good idea to create a Page view with some dummy path and load the View's route and get it's content and display it via mine route controller?

At first I've used the config option mentioned by Daniel Wehner but I ended up with using a custom filtering form + query tag. This gave me much better flexibility and customization options than Views' exposed filters.


texts: Unable to display taxonomy attributes in select list

texts:
I am building a site for a gift seller. Many of his products have attributes which are unique to a given product. But these are too great in number to be bothered creating separate variation types.

The following page from the clients existing site provides a few examples. http://www.peekaboogifts.co.uk/products.asp?p=Scented+%26amp%3B+Novelty+Candles&category=31

What I want to do is have one taxonomy vocabulary called 'free text' which can be used as the main variation type, using an autocomplete widget so that new taxonomy terms can be added easily via the inline entity form.

So far this seems to work for me except for an issue with the product display. For some reason the Attribute selection widget outputs the product title multiple times, instead of the individual variation names. When any of these are selected though, the correct variation is displayed.

Any suggestions of how to correct this?


texts: SMB shared video files from Windows to Linux

texts:
So, this might be more of a general Linux question, but I've tried everything I can think of with permissions, andI'm having the issue in Drupal, so I'm hoping someone here has an idea.

What I want to do: Use the Video module to play video files from a shared network folder; the folder is on a Windows Server 2012 system. (I realize the Vide module is geared towards uploading files, but if I manipulate the uri in the file_managed tables, I can change it, so I'm going to use the module to add the content, then edit the uris accordingly.)

1) Video defaults to the files/default/videos/originals folder for storing uploaded videos
2) I mounted the network folder at files/default/videos/originals/movies
3) Then I changed the uri for the video file to point to the mounted network folder

Now, I can change the uri to other local directories, and it works fine (I even had a symlink at one point leading out to my own user directory), but whenever I try to play the file (with the DivX player, since it seems to be the only one I tried that gives me an error message, instead of just hanging), I get a 403 error.

I've set the group and user of all involved to apache (and using ls -l, that seems to have been set), and my mount command in /etc/fstab is listed below

\\192.168.0.3\movies /var/www/html/sites/default/files/videos/original/movies cifs uid=48,gid=48,ro,suid,username=userName,password=passWord 0 0

(I used uid and gid because if I tried user and group, nothing happened.)
I've been fighting with this for hours, and I have no clue. Thanks for any help.

Running the following code from within Drupal returns nothing, but running the exact same code after placing it in "file.php", and calling "php file.php", and it returns the files in the directory fine.

glob('/var/www/html/sites/default/files/videos/original/movies/*.*')

I could really use some help with this.


texts: Custom nested element and its child sub-elements callbacks

texts:
I'm trying to create a custom element that consist of a few other elements, namely some select box and one timeperiod element.

I've set up custom #process, #value_callback, and #element_validate and everything works well with one exception. The #element_validate` of timeperiod element is run after my own elemen's callback is which means I can't effectively use the results of that field for either validation or creation some structured output.

As far as I know it's a normal drupal7 behaviour, callbacks on forms are supposed to be run top->down. That said, however, I still need some after-submit callback on higher-level element that can access already final results of all of its children elements.

I'd also love to know why has top-down approach been chosen. Because no matter how much I think about it it's just completely non-sensical.

Specific example:

function TST_element_info() {
  return array(
    'station_channel' => array(
      '#input' => TRUE,
      '#tree' => TRUE,
      '#process' => array('TST_element_process'),
      '#value_callback' => 'TST_value_callback',
      '#element_validate' => array('TST_element_validate'),
    ),
  );
}

function TST_element_process($element, &$form_state, $form) {
  global $user;
  $opts = array(/* magic */);
  $element['Sel'] = array(
    '#type' => 'select',
    '#options' => $opts,
    '#empty_option' => t('Tsss'),
    '#empty_value' => 'default',
  );

  ...

  $element['Per'] = array(
    '#type' => 'timeperiod_select',
    '#title' => t('Tsss:'),
    '#required' => true,
     '#units' => array(
       '86400' => array('max' => 365, 'step size' => 1),
       '3600' => array('max' => 23, 'step size' => 1),
       '60' => array('max' => 55, 'step size' => 5),
     ),
  );
  return $element;
}

function station_channel_value_callback($element, $input = FALSE, &$form_state) {

  if (empty($input) || $input == 'default') {

    if(isset($element['#default_value'])) {

     /*magic*/

    } else {

      return false;

    }

  } else {

    $Sel =  $input['Sel'];
    $Per = $input['Per'];

  }

  return array(
    //I'd need need to return something like (or I could do it in validate):
    //But can't do it here because $input['Per'] contains raw input from its three textfields instead of computed timestamp (and even if I altered the module to do the computation in its #value_callback it would still not help because their callback is run after mine).

    'path' => "weirdStuff/$Sel/period/$Per/json"

     //Therefore I have to return:
    'Per' => $Per,
    'Sel' => $Sel,

  );
}

function TST_element_validate(&$element, &$form_state) {

  // Magic validation

  $Sel = $element['#value']['Sel'];
  $Per = $element['#value']['Per'];

  $validated_input_array = array(
     //Again, I'd need to do this but can't because timeperiod's element_validate is run after mine which means their $element['#value']['Per'] still contains raw data.
     'path' => "weirdStuff/$Sel/period/$Per/json"
  );
  form_set_value($element, $validated_input_array, $form_state);

}

//It's perfectly ok in form_submit, the form_state['#values'] contains computed (timestamp) data for the period field. But that is kinda too late for my own element.

PS: Consider this example but with one of the sub-elements that are used for connection string connection being a bit more complex one that computes its true value in #element_validate.


texts: Mail manager sending email to site email

texts:
I'm sending emails programatically from a custom module, the email sends correctly to the user, but it also sends the email to the site email. Is there anyway to stop this from happening? When I receive the email it contains a reply-to link of the site email.

$mailManager = \Drupal::service('plugin.manager.mail');
$module = 'my_module';
$key = 'email_key';
$to = $user->get('mail')->getValue()[0]["value"];
$params['message'] = "Some message";
$params['subject'] = "Some subject";
$langcode = $user->getPreferredLangcode();
$send = true;
$result = $mailManager->mail($module, $key, $to, $langcode, $params, NULL, $send);


texts: conditionnaly change the status message?

texts:
I have a form that contain muliple lines...
every line represent an entity entry, and when submitting the form I get a very long status message :

- the entity 'ENTITY_NAME' has been saved.
- the entity 'ENTITY_NAME_2' has been saved.
...
...
...

I want to change these messages to a single one, for example : "your changes have been saved"

Thanks in advance.


texts:
I used this code to get a pager.

   if (isset($_GET['tid'])) {
     $id=($_GET['tid']);
     $query = new EntityFieldQuery();
     $query->entityCondition('entity_type', 'node');
     $query->entityCondition('bundle', 'escorts_product');
     $query->pager(2,1);
     $query->propertyCondition('status', 1);
     $query->fieldCondition('field_product_sub_cat', 'tid', $id,'=');
     $result = $query->execute();
    //print "<pre>";print_r($result);
    }

When I used print "<pre>";print_r($result), it gave me 2 results on y page, whereas I added more than 2; this is right.

How should I get links for next page and also previous, next? Is there any other way to get a pager?


texts: Views exposed filter between label AND replace with -

texts: how do I change exposed filter BETWEEN label? There is default "AND"-text and I need to change it to  "-"


texts: Drupal way of sending push notification to android devices

texts:
I am trying to send push notifications to Android, and Apple iOS devices. To store the device tokens, I am using cocoa rest client. For iOS devices that is fine, but I didn't understand how to store RegId and token for the Android devices. as we have only 4 attributes, namely:

token
uid
type
timestamp

Generally, for Android we have to store RegId and device token, but in the table we don't have any attribute to store Regid. I am giving post values as type=android,token=device token.

Will this help me to send push messages to Android devices? Without RegId, I think it is not possible.

I am using the Push Notifications module.


texts: How to remove DISTINCT from VIEWS query?

texts:
Apparently while optimizing Drupal 6 performance, I found that somewhere DISTINCT is getting added into VIEWS query without added by any means like VIEWS UI or hook_views_query_alter.

When tested with devel module, found that the SELECT query getting executed have the DISTINCT clause. I am having VIEW displayed in a block shows latest 10 nodes. VIEWS's Live Preview doesn't show any DISTINCT added in SELECT statement, but same query when executed at front end shows DISTINCT in devel query log.

I am not understanding where its getting added? Is there any way to remove ?


texts: I want to create tabs inside the node body and so I found the yui_tabview module but it only works in Drupal 6. Anyone know a module that works for Druapl 7?


texts: On a Drupal Commerce project of about 2000 products, the client wants to set sale prices for some of the products. The client also wants to set a sale expiration per product so that after a certain date, the product is no longer on sale. Is there a module or technique that could accomplish this easily?


texts:
I'm porting a module from Drupal 7 to Drupal 8. In this module's configuration settings I need to get the list of the currently existing field-types.

In Drupal 7, this was achieved using the field_info_field_types() function.

In Drupal 8 (8.0.0-rc3), I get an error "function does not exist", despite the information stated by a Drupal API Reference Help page, clearly out of date.

Then investigating I found a DrupalContrib page, where the function is declared deprecated, and proposing to now use Drupal::service('plugin.manager.entity.field.field_type')->getDefinitions().

But using it fires another error "Unknown service plugin.manager.entity.field.field_type", fortunately associated to the suggestion "Do you mean plugin.manager.field.field_type?"

So I tried using Drupal::service('plugin.manager.field.field_type')->getDefinitions() and wow: I got the expected array of field-types.

But each array member (one field-type) is now an object (instead of a child array), and the data I'm looking for is nested within protected properties, so I can't access them.

At this stage, I'm stuck. I considered it might exist some class I could expand to navigate through these data, but with no luck: I notably couldn't even figure out which is the component in Drupal 8 where field-types definitions is centralized.


texts: How to remove  tags when printing out Menu

texts:
Is there any way to remove HTML list tags when this function is called to access Main Menu?

This code is used in page.tpl.php in for a theme:

print theme(
  'links__system_main_menu',
  array(
    'links' => $main_menu,
    'attributes' => array('class' => array('topNavItem')),
  )
);


texts:
In Drupal 7, you can use module_exists() to check whether a module is enabled (as well as whether it exists).

For example,

if (module_exists('devel')) {

How can you check whether a module is enabled in Drupal 8?


texts: Entity Reference. Hide not user referenced terms in node form?

texts:
This is my 2nd question about my problem, the last was "Users have access to add Commerce Products into the Store and publish it. How to display to user only allowed firms in the product addition form?"
 I am writing my 6th module and I do not know nothing about form fields arrays.
I need to display in node addition form only user referenced terms in field Firms.
Taxonomy "Firms" has field_seller of type Entity Reference. I add to all Firms terms users that must have access to them. How can I display to user only those terms that have reference to this user when he add node Product ?
I've made this code that has only correct name (I've checked this with other funcions that was in it and worked):

/* Displays only terms that have Entity Reference field with current user reference */
function user_referenced_taxonomy_terms_form_node_form_alter(&$form, &$form_state, $form_id) {
  //$form['field_firm']
}

how to get array $form['field_firm'] of terms that have reference to current user if the user role is not admin?


texts: How to disallow one domain path in robots.txt without any modules?

texts:
How to disallow one domain path in robots.txt? (there is a module which allows to do that but it is better to avoid it because of performance issues)
For example, onedomain.com/path1/* must be disallowed. Is it right to type like this in robots.txt (there is another domain twodomain.com for the same website):

Disallow: onedomain.com/path1/*

Twodomain path must be allowed to be crawled and Onedomain path must be disallowed to be crawled (both of them are pointing to the same path).


texts: Is it possible to turn off the auto-pathing for the Pathauto module?

texts:
I use the Pathauto module for several uses, such creating URL patterns.

I do want to turn off only the main feature of the module which is --- Auto path creation for nodes... Why? Because some of my H1's aren't in English, but the alias should be English and be setted manually. An efficient solution will be:

Finding a way to disable this specific functionality of the module so I could still use all it's other functionalities, and not lose it completely.
NOT BE ABLE to save the node only until I manually wrote an alias (if I saved it with a no-English alias mistakenly this could be problematic for SEO if I change it after the webpage has already been indexed).

You might came across any solution for this?


texts: How does the new config_exclude_modules setting work exactly?

texts:
Drupal 8.8 introduced a new setting: https://www.drupal.org/node/3079028

By adding these lines to your settings.local.php I expected the modules and their configuration to be excluded from config export.

$settings['config_exclude_modules'] = ['kint', 'devel'];

However:

kint and devel still appear in my core.extensions.yml
Yaml files related to devel still get generated.
Modules are still removed and installed based on the core.extensions.yml

How does this feature work?

Edit: I upgraded from Drupal 8.7, that seems to keep this function to work properly.


texts: What changed in the way to implement a block?

texts:
The documentation for Drupal 8 lists the following hooks as the ones necessary to implement a block.

hook_block_access() controls which users have access to a block
hook_block_view_alter() is used to alter how a block implemented by other modules is rendered
hook_block_view_BASE_BLOCK_ID_alter() is a specialization of the previous hook, similarly to what hook_form_FORM_ID_alter() is for hook_form_alter()

What I don't find is hook_block_info(), which in Drupal 7 allowed to expose the blocks defined from modules, and hook_block_view(), which was invoked when a block defined from a module was rendered in a page.

How do modules expose blocks, in Drupal 8? How are the blocks rendered?


texts:
I created a clone of a view and have completely forgotten why I did that.
I suspect that I was experimenting, but before I delete the view, I want to make sure that it is not being used.
Is there a mechanism by which one can list where views are being used?


texts: Is there any way to change home page on small screen?

texts: I want to change the home page for small screen. Is there any way to set the front page according to the screen size by using hook_preprocess_page() or any other?


texts: Commerce add product attribute without adding new product variations

texts:
I have found this Commerce manual: Product Attributes & Variations, which explains the differences and connections between fields, attributes and variations, where in the end they assign a different product to each product display.

The situation I am in is as follows. Let's say I sell lunchboxes. The same model is available in 5 colors and the lid is always white. But now I want to add an option to the shop where people can order a lid in the same color as the lunchbox. My SKU's are as follows:

lunchbox_red
lunchbox_blue
lunchbox_...

I was hoping this could become a simple product attribute (a checkbox?), but it seems I will have to add a second version of my 5 products with the extra costs of the lid:

lunchbox_red
lunchbox_red_lid_red
lunchbox_blue
lunchbox_blue_lid_blue
lunchbox_...

I initially wanted to let people choose the color of the lid, but that would require me to maintain 25 different products for each box-lid combination!?

lunchbox_red
lunchbox_red_lid_red
lunchbox_red_lid_blue
lunchbox_red_lid_...
lunchbox_blue
lunchbox_blue_lid_red
lunchbox_blue_lid_blue
lunchbox_...

Since I don't really care about the photo (I would definitely need a product for each lid combination in that case), I was hoping for a smarter way to implement this.

Can I add a general attribute (with added costs) to all product variations without adding all the products? The price for the coloring of the lid will be a fixed price, not depending on the color used.


texts: Custom formatting of tokens for date fields

texts:
In D8.1, I have created a field called field_date and added it to a content type.

I try to use pathauto to try to configure a URL pattern for the content type like type/year/title. But the token browser does not expose expandable date options for date_field. If I enter it manually, I get "The Path pattern is using the following invalid tokens: [node:field_datetime:custom:Y]."

How can I format the output of a token for a date field, the same way I can for a node property like date created?

I've searched the issue queues for contrib token, core datetime and core token system, but I find nothing about this.


texts:
I'm writing a custom module which will process information using an external service and need to display any errors thrown by this service.

I already have a variable containing error messages.

How can I target a page body markup to show the error message? I have tried hook_page_alter but failed not knowing if a page body can be processed at this stage.

Thanks


texts: How do I display all terms of nodes created by user in a user view field

texts:
I have a User view where I list user information with contextual filter UID. I want to display all the terms from the nodes that the user added. I added the Author relationship so that way I can display the terms field to the view.

The issue is that the field only displays the terms of the first node added by the user. The aim is to display all the terms of all the nodes added by the user. Preferably with no repetition.

So if user U added node A with term X and Y and also added node B with term X and Z, the views filed should display term X, Y and Z.

What am I doing wrong that only the user's first node's terms display?


texts: Display Suite - code field retrieve the first value in a multivalue field?

texts:
I've created a view mode to display a value multivalue image field. The rendered entity utilizes display suite to display the images. There are 12 images in this field for this all of the nodes of this content type.

Is it possible to just display one image instead of the 12 as a code field in display suite? If so how does one do that.


texts: I'm probably completely over thinking this

texts:
I am working on a calendar for our agency and want to have public access to submit events using a webform created from the webform module, and of course this event would not be published without admin signing off on it.

It doesn't appear this is a normal feature in webform/views/calendar module.  What am I missing?


texts: How do I reroute a logged-in user after page access denied at user/login?

texts:
My Drupal 6 site has the login form at /user/login. If I'm logged in already and I click it, I'm sent to the Access Denied page (though the login URL stays the same).

I'd like to send such users somewhere else. Anywhere else. /user would be fine. Is there anything I can hook into to achieve this?


texts: schema: being stripped from typeof attribute (Structured data aka RDF)

texts:
I've got a field on my account, named bio. In this field, I'm manually adding the following:

Jaypan

However, the resulting HTML is as follows:

Jaypan

I set a text filter that doesn't do anything - it allows the inputted text as-is. Everything else is exactly as I entered it into the text area. But something in Drupal is stripping out the schema: from the typeof property.

I've dug deep trying to figure out where this is being stripped, but I'm not finding it. Does anyone know? I'm suspecting it's something in the RDF module, but I haven't found it in there yet.


texts: Strange behavior: Extra css classes are NOT merged with the 'Search Block' form tag classes but with those of BLOCK wrapping the form tag

texts:
i'm experiencing such 'strange' behavior with Drupal (v8.7.10) when trying to add css classes to the default Search Form form tag using MYTHEME_form_FROM_ID_alter hook, the classes are NOT merged with the form tag classes as expected but with those of the BLOCK wrapping the form tag itself.

this is my code:

function MYTHEME_form_search_block_form_alter(&$form,\Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form['#attributes']['class'] = 'form-inline';
}

and this is the rendered output in question

  <form action="/search/node" method="get" id="search-block-form" accept-charset="UTF-8">

      Search
      <input title="Enter the terms you wish to search for." placeholder="Search .." data-drupal-selector="edit-keys" type="search" id="edit-keys" name="keys" value="" size="15" maxlength="128" class="form-search form-control rounded-0">

      <input data-drupal-selector="edit-submit" type="submit" id="edit-submit" value="Search" class="button js-form-submit form-submit btn btn-primary rounded-0">

  </form>

any thoughts ?


texts:
I'm trying to get the value of a field and use it as a class for a wrapper of another field within a Views display. So essentially what I need is to be able to get a string representation of the first field. The field already is a text field but when I try getting the content it doesn't just give me a string, which is what I need to be able to use is as a class for my second field.

I've tried using {{ fields.[field_name].content }} but that renders the twig template recommendation along with the data. I tried using the getValue() function, but that doesn't return anything. I tried passing the data through the raw twig filter but that doesn't return anything. I tried rendering the array using dpm and kint but they both give me way too much information and I can't narrow it down to what array item or object I need to use. I'm new to Drupal so maybe I'm not using Devel and Kint correctly to find what I'm looking for.

Is there a function I have to use to get the content data as a string or just raw, or is there some other way I can accomplish this?

I am using Drupal 8.1.


texts:
The current default pager in Views Paging Drupalgap is easily neglected.

Can I assign it a new icon or create my own pager button? Currently, what I know is to put it at the top or the bottom using pager_pos: 'bottom', but nothing else.


texts: Is ContentEntityBase::access affected by hook_ENTITY_TYPE_access?

texts:
Are calls to the access() method on entity objects which is provided by ContentEntityBase affected by hook_ENTITY_TYPE_access()?

I am asking because the Paragraphs module, in src/ParagraphAccessControllHandler.php, contains the following code.

protected function checkAccess(EntityInterface $paragraph, $operation, AccountInterface $account) {
// Allowed when the operation is not view or the status is true.
/** @var \Drupal\paragraphs\Entity\Paragraph $paragraph */
if ($paragraph->getParentEntity() != NULL) {
  // Delete permission on the paragraph, should just depend on 'update'
  // access permissions on the parent.
  $operation = ($operation == 'delete') ? 'update' : $operation;
  $parent_access = $paragraph->getParentEntity()->access($operation, $account, TRUE);
  return AccessResult::allowedIf($operation != 'view' || $paragraph->status->value)
    ->andIf($parent_access);
}
return AccessResult::allowedIf($operation != 'view' || $paragraph->status->value);
}

The following hook is in the Block content permissions module, in block_content_permissions.module.

function block_content_permissions_block_content_access(EntityInterface $entity, $operation, AccountInterface $account) {
  // Disallow operation access to entity based on user's permissions.
  switch ($operation) {
  case 'delete':
  case 'update':
  // Get block content type.
  $bundle_type = $entity->bundle();
  // Check permissions for block content.
  // Negate to hide operation link.
  return AccessResult::forbiddenIf(!(
    $account->hasPermission('administer block content') &&
    $account->hasPermission("$operation any $bundle_type block content")
    ));
 }
 }

By using kint(), I can tell that checkAccess() is being called, but the hook isn't running. I realize that the block content module is experimental, but theoretically this should work and is in fact working for performing actions on blocks themselves.


texts: Fatal error: Call to undefined function node_type_get_names() Drupal 7.59

texts:
I upgraded my Drupal site to Drupal 7.59 and now the site is down.

Fatal error: Call to undefined function node_type_get_names() in D:\Development\xampp\htdocs\biobank\modules\comment\comment.module on line 119

List of installed modules:

admin_menu
autocomplete_deluxe
autologout
better_exposed_filters
bootstrap_fieldgroup
chosen
conditional_fields
ctools
date
devel
empty_front_page
entity
entityreference
entityreference_autocreate
exclude_node_title
field_collection
field_collection_table
field_collection_views
field_group
field_validation
jquery_update
mass_pwreset
module_filter
msnf
restrict_ip
securelogin
security_review
termcase
title
token
unique_field
vefl
views
views_bootstrap
views_data_export
webform


texts:
I would like to warm-up Twig templates after cache rebuild or when needed. By warming-up I mean to process each twig template into php file.

Is this possible without rendering the content first?


texts: How to migrate users and keep their IDs unchanged?

texts:
I'm trying to use migrate_d2d, via the UI, to migrate a site from D6 to D7.  I need to preserve user UID's in the migration.  I'm finding the documentation confusing..

Given this in the UI...

What do I need to do to import the users?


texts: Printing fieldable panel pane custom field in template properly

texts:
I've created a fieldable panel pane that has two fields, a title and a body. My template file looks like this:

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

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

This seems fairly basic. Now, when I actually add one of these panes to a page, this is the DOM that is spit out:

    Test Pane

This is a test body.

Ignoring the fact that it's printing out empty field-label elements, why is the pane-title field being printed outside the pane-title h2 element? Is there a better way to be doing this? Thanks!


texts: How do I get my custom route to a custom menu link

texts:
What I am trying to do is:
I want my custom form to show up on a custom path under

    /admin/config/content/mymodule

My routing.yml looks like this

    mymodule.mymoduleform:
      path: '/admin/config/content/mymodule'
      defaults:
        _form: '\Drupal\mymodule\Form\Mymoduleform'
        _title: 'Mymodule'
      requirements:
        _access: 'TRUE'

And my menu.links.yml like that

    mymodule.admin:
      title: 'Mymodule'
      description: 'Manage mymodule'
      parent: system.admin_confifg_content
      route_name: mymodule.mymoduleform
      weight: 100

Pityfully the doku is very thin about that hope you guys have a clue bout this :)

Or maybe i have to figure out how I get the right parent.
I want that menu link displayed under "Content Authoring"


texts:
I am new in Drupal 7 and I am trying to format my text using CKEditor. I started to create a basic page, I supplied the Title since it is a required field, then I put my text inside the body, there is a section in the Body that I want to use <h1> to make it look like the page title. So to do this, I clicked Heading 1 from the Format drop-down. On my editor the text now looks bigger, but when I tried to save it the <h1> tag was not implemented. I also tried to style my text using css but it didn't work.

How can I fix this?


texts: Running a queue worker without using cron tasks

texts:
I implemented hook_queue_info() with the following code.

function ecc_general_queue_info() {
  $queues = array();
  $queues['adding_checklist'] = array(
    'worker callback' => '_ecc_general_apply_queue',
    'time' => 60,
  );
  return $queues;
}

I create  items for the queue with the following code.

$queue_factory = \Drupal::service('queue');
$queue = $queue_factory->get('adding_checklist');
$queue->createItem([$node, 'insert']);

The callback function is the following.

function _ecc_general_apply_queue($item) {
  // Some code here.
}

I want to run this callback for each item in the queue. How can I process the queue to execute its worker callback for each item?

I don't want to use cron tasks for processing the queue.


texts: How feasible is a Drupal 8 with a different language depending on its subdomain

texts:
So, let's say I have this massive content-heavy site with all sorts of paths like mysite.org/category/date/slug or mysite.org/someterm/subterm/date/slug. Let's say all this content is in English, and now I've gotten my hands on a Spanish version of all of my content. How feasible is it to integrate the Spanish content into the site, using the same installation, but only having the site show up in Spanish when people go to es.mysite.org, es.mysite.org/category, or es.mysite.org/someterm/subterm/date/slug.

How scalable is Drupal 8 in this regard? If we want to have several different language sites, potentially with different templates, would it be best to use different installations of Drupal 8 or does it facilitate this kind of set up I explained above so that one installation is perfectly logical?


texts:
i have a image gallery in my website created from nodes, so 1 node is equal to 1 album, each node has all images uploaded .. it seemed to work fine, until - somehow the dragger have been replaced with "weight" when i edit the node/album.
Also, eventhough i have no limit set, it only uploads the first 20 selected pictures, eventhough i select and upload 35 pictures .. i dont know why this happened.


texts: Database migration from Postgres to Mysql

texts:
We have a website in Drupal 7 running on Postgres database. We are planning to upgrade to Drupal 8 very soon, but we want to first migrate the database from Postgres to Mysql.

I was just wondering if anyone has done this before and has any thoughts about how to do this? I see some options in Mysql Workbench but haven't tried it yet. Any suggestions?


texts: How to save lat/lon of author's location with node

texts:
I have a public node creation form that unauthenticated users will submit.  I want to save the visitor's geographical location with the node that they create.  I imagine capturing their lat/lon and inserting that into a hidden field in the form.

For reading the lat/lon, I have Smart IP installed.
I've tried to use Smart IP's tokens to insert the values into a field, but I get an error:  Undefined index: longitude in smart_ip_tokens()

At this point, I will try any way of reading and capturing the user's lat/lon and of associating it with the node that the visitor creates.

Any suggestions, please?

UPDATE:
the Smart IP tokens are successfully inserting the lat and lng as default values into text fields that I've "hidden" from public view by disabling them in Display Suite.

This notice continues to show: Undefined index: latitude in smart_ip_tokens() (line 309 of ../modules/contrib/smart_ip/smart_ip.module).  Further, the error displays in FF v.27.0.1, not in Chrome v.33, not in IE11 and it is present on both the node-create form and the node display.


texts: How can I use stemmer with Search API Solr but show non-stemmed results in the autocomplete form?

texts:
I'm trying to use the Greek stemmer with Apache Solr. If I edit the schema.xml and add the lines:

    <filter class="solr.GreekLowerCaseFilterFactory"/>
    <filter class="solr.GreekStemFilterFactory"/>

in both analyzers (index and query) of the text fieldType, the stemming works without problems and proper results are being returned. However, the suggestions that are created both in the facets and in the autocomplete form, include the stemmed version of the various keywords. I suppose that this makes sense from a developer's point of view, but the stems that are produced have no actual meaning in Greek.

I did a lot of research (I'm not a Solr expert but I'm starting to learn the basic stuff due to this issue) and I'm hitting a wall. I tried to use many variations of the solution that is described in the question: "How to index fulltext fields with and without stemming" but I can't get solr to copy the fields that I'm interested in, into the dynamic fields that I create (I can see the dynamic fields in the solr interface but no content is copied to them). I even tried to use the filter only in the query analyzer and only in the index analyzer (you can guess how that went).

Any ideas on how I can get this to work properly?


texts: How to remove the home link in menu breadcrumb in drupal

texts: I am using menu breadcrumb module in my drupal. I get the breadcrumb like as Home>Content>Aboutus but i need a structure like Content>Aboutus.How can i do this


texts: How to make a link between Drupal and my ownCloud server?

texts:
I want my documents uploaded from Drupal to be directly stored on my ownCloud server. Drupal server and ownCloud are both installed in the same machine.

Do you know how to do this type of action?


texts:
I already asked a question like this (Set date field in D8).

Ok duplicate entry? NO!

Now i have also to set a time and i'm using a array.
My code looks like this.

$field_array = [
##begin of creating node
'uid' => $new_old_uid["new_uid"],
'type' => $content_type,
'langcode' => $lang,
'status' => (!empty($import_node->status)) ? $import_node->status : 0,

#### How to create date with times?
#Every Version causes that error -> Array to string conversion in ....
### Version 1
'field_event_date_start' => [[ "value"=> date('Y-m-d H:i:00',$imported_date) ]],
'field_event_date_end' => [[ "value"=> date('Y-m-d H:i:00',$imported_date) ]],
### Version 2
'field_event_date_start' => [ "value"=> date('Y-m-d H:i:00',$imported_date) ],
'field_event_date_end' => [ "value"=> date('Y-m-d H:i:00',$imported_date) ],

### How to add a url?
'field_event_url' => (!empty($import_node->field_event_url)) ? array('value'=> $imported_url) : null,
];

UPDATE:
Another try for datetime field:

'field_event_date_start' => array(
    "value" => array(
        "date" => date('Y-m-d',$imported_date),
        "time" => date('H:i:00',$imported_date)
    ),
),

Now I'm getting following error:
Placeholders must have a trailing [] if they are to be expanded with an array of values.


texts: How do I get a custom help text on a link field if title of the field is hidden?

texts:
I created a link field, and disabled its title, put some custom help text for the link field. It only shows the default help text underneath, like below but with no custom help text.

  Start typing the title of a piece of content to select it. You can also enter an internal path such as /node/add or an external URL such as http://example.com. Enter <front> to link to the front page.

How can I only get a custom help text rather than the default help text? Eventually, is there a way to get both?


texts: Disappeared output of banner after updating from d7.31 to d7.32

texts:
I have set up a website using mamp. And it has a banner on the front page. I did a back up of files and database before updating. After I updated the core, banner has disappeared from the front page. The rest images, nodes, blocks and views are still in the right place. The view of the banner still exists, block is attached to the same region, images are in the right folders and after creating another banner it did not appear. I checked html and this is where banners supposed to go appears to be empty.

I do not know what have caused the issue during the upgrading. I can get the previous version from my back up, however, I am interested why did this happen and how can I fixed it without going to my back up. As this not an expected behaviour from drupal.

Update

I figured out that after updating the core flex slider module has disappeared and flex slider slideshow view parted from the module, so I had to install both and set up the banner view to flex slider again but now I am facing a different obstacle. The image in my banner is shifted to the right like in the image below.

I still cannot figure out what makes it shift and how to solve it.


texts: How to pass variable from block and access in it twig template

texts:
I'm trying to make custom block but I have problem accessing variables in template.

My block code:

namespace Drupal\more_topics_rollout\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
 *
 * @Block(
 *  id = "more_topics_rollout",
 *  admin_label = @Translation("More topics rollout"),
 *  category = @Translation("Blocks")
 * )
 */
class more_topics_rollout_block extends BlockBase {
    /**
     * {@inheritdoc}
     */
    public function build() {
        return array(
            '#title' => 'More topics'
        );
    }
}
?>

My module file:

function more_topics_rollout_theme($existing, $type, $theme, $path) {
    return array('more_topics_rollout' =>
        array(
            'variables' => array(
                'title' => null,
                'body' => null,
                'description' => null
            ),
            'template' => 'block--more-topics-rollout'
        )
    );
}

And when I'm trying to display title with {{ title }} it doesn't render. When I'm trying to access variables I know for sure don't exist like {{ dasdasda }} it doesn't throw any errors. Can someone explain this behavior to me?


texts: How to access remote index in search_api?

texts:
I have two drupal installations, one instance contains data like entities. The other one access this entities with service-calls and display the website.

I would like to make the entities searchable for users with search_api(_solr) and created an index in the data server which contains the entities.

Now.. How can I access this index from the other drupal installation? I found the services_search_api module, but there is only a DEV Version :-(

Thank you in advance for your help.


texts: Printing an Entity Reference Field Value in a field collection in views-view-fields.tpl.php

texts:
I am overriding my view with the template views-view-fields.tpl.php, and have called it views-view-fields--front-featured-blocks.tpl.php

I wont bother putting all of my code for this block up, but the two defining lines of my code are as follows...

  <?php print $fields['field_link_to_content']->content; ?>

  <?php print $fields['field_block_title']->content; ?>

The field_block_title span prints a value, but the field_link_to_content does not.

The field_link_to_content is an Entity Reference field, which is printing the Entity ID, which I need to build a link.

Can anyone tell me why this doesnt work, but I can print every other field in the same method? The entity reference field is only allowed one value, but is there a delta value involved? How would I print a list of allowed values? I have devel installed.


texts: How to check if a new node is correctly created using Entity Metadata Wrapper $wrapper->save()?

texts:
I'm programmatically creating a new node using Entity Metadata Wrapper.

How to check if last instruction:

$ewrapper->save();

creates correctly the new node without errors?


texts: How can I format the date like this in search-result.tpl?

texts:
In node.tpl I have

<div class="imported-text">

Created on <?php print date('l', $node->created); ?>, the <?php print date('jS', $node->created); ?> of <?php print date('F Y', $node->created); ?>.

</div>

But when I place this in search-result.tpl I get an error. <?php print $info_split['date'] ?> can only use the short format AFAIK.


texts: How to include both taxonamy and content type in a single views exposed search form

texts: I need to add an exposed search block using views in the site. Which searches the data in content types and taxonomy terms that i specified in my views filter. Any way to do it.