I am using the beta release of the  module, and I encounter a feature issue in the code.  My goal is to display a simple login label of the block rather than using the default provided by the module. To explain, in line #92 of the file , #value is defined as  '#value' =&gt; t('Log in with @client_title', [   '@client_title' =&gt; $client['label'], ]),   but I want to make it simplier, just #value' =&gt; t('Log in),  Is there any way to create and apply patch for beta release or other workaround how this can be handled? (Not hardcoding in the file itself)  The actual block displays the following.        What I want to show is the following.        How do I change the submission button text?
123031
I'm trying to change the submit button text "Save and keep published", but with no luck. I'm using the standard hook_form_FORM_ID_alter().   function mymodule_form_node_news_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {   // This is the problem, what should I put here   $form['actions']['publish']['#value'] == ''; }   This is what dpm() returns.  'publish' =&gt; array(7)   '#value' =&gt; object Drupal\Core\StringTranslation\TranslatableMarkup(5)     protected string -&gt; string(18) "Save and keep published"     protected translatedMarkup -&gt; NULL     protected options -&gt; array(0)     protected stringTranslation -&gt; NULL     protected arguments -&gt; array(0)   How do I change text on the submission button in the node form?
87707
I've got a D7 content type with a few fields; nothing particularly special.  I want to be able to programattically change the values of those fields from time to time, and so wrote a function like so:  function set_field_value($field_name, $node, $value) {     $wrapper = entity_metadata_wrapper('node', $node-&gt;nid);     $wrapper-&gt;$field_name = $value;     $wrapper-&gt;save(); }   This worked in a few test cases (like changing the title of a blog node), but when I try it on content type fields, I get an error like:     EntityMetadataWrapperException: Entity property field_project_video_status_yt doesn't support writing. in EntityStructureWrapper->setProperty() (line 497 of ...)   What I'm doing wrong?
64273
Currently trying to update a field every time a node is created or updated. However the value is not being populated within the node, do I have access to the node object with this particular hook? What could I be missing?    function vbtoken_node_update($node) {         entity_get_controller('node')-&gt;resetCache(array($node-&gt;nid));         $types = node_type_get_types(); //What are the current Node Content Types?       $yes = ($types['volunteer_project']-&gt;type);        if($node-&gt;type === $yes){           $hash = md5($node-&gt;title . $node-&gt;nid . $node-&gt;nid);         $hashed = substr($hash, 0, 6);         $node = node_load($node-&gt;nid);         $node-&gt;tcode[$node-&gt;language][0]['value'] = $hashed;         node_save($node);          watchdog('vbtoken', 'Added a new Token code to %nid', array('%nid' =&gt; $node-&gt;nid));          }         else          {           dpm('not working dude');         }      }
89893
The __debug__ variable is handy in part because it affects every module. If I want to create another variable that works the same way, how would I do it?  The variable (let's be original and call it 'foo') doesn't have to be truly global, in the sense that if I change foo in one module, it is updated in others. I'd be fine if I could set foo before importing other modules and then they would see the same value for it.
21905
I tried to update a jQuery code block that was missing a curly brace. The code is incorrect, but I cannot edit it since changes under 6 characters are not allowed (at least at my level of rep?).  I understand why you don't want to allow minor copy-editing, and I agree that's fine for textual descriptions and regular writing, but 1 character can make a big difference in code.
85601
In Drupal 8, is there a way to figure out what current block or view machine name you should use?  For example, with the following code, I noticed that 'machine_name_to_determine' could change depending on how many times you have used your block.  $block_id = 'machine_name_to_determine'; $block_config = \Drupal\block\Entity\Block::load($block_id);   I need a way to retrieve this at run-time. How can I retrieve it?
85415
I want to show a custom block, only when log in has failed. So from visibility settings I have to put a PHP code that returns TRUE only when the login has failed.  But how could I "catch" that event? Do I have to use variable_get(..)? And if yes, how could I use that?with what attributes?  Thank you.
73786
I'd like to update the label of an operator when it's called. But this :  def execute(self,context):     self.bl_label = "good night"   ... apparently doesn't work if the bl_label property has already been defined. Am I wrong ?
48930
I read about Drupal behaviors today, and I tried writing the following code.  (function ($) {    Drupal.behaviors.mymodule = {     attach: function (context, settings) {       $('#mymodule_id', context).change(function () {         alert('Handler for .change() called.');       });     }   };  }(jQuery));    Is Drupal.behaviors.mymodule the namespace? What are the context and settings parameters passed to the Drupal behavior? Is this the equivalent of document.ready()?   Can I attach any number of functions?  Can I define JavaScript functions which will be called somewhere?
105914
I have a couple of blocks that have been created using the ... extends BlockBase syntax in my module. They work perfectly fine, and I can add them on the blocks layout page, can add them into DS as a field, etc. They definitely exist fine.  However, when I try and render them using Block::load(), they won't show up, unlike other blocks that work fine.  For example, if I have the following docblock:  /**  * Provides a 'Cute Cats' Block.  *  * @Block(  *   id = "cute_cats",  *   admin_label = @Translation("Cute cats yo"),  * )  */  class CuteCats extends BlockBase { ... }   ... and then try and call it like this:  $block = \Drupal\block\Entity\Block::load('cute_cats'); return render(\Drupal::entityTypeManager()   -&gt;getViewBuilder('block')   -&gt;view($block));   Any idea why? Thanks in advance.
58950
In views I can add PHP snippets for custom validation or when I want to provide default value for contextual filter. It is telling me that I can use $view or $argument - but where is documentation of these objects? Where can I read what are my possibilities in these areas (or how check this, by using debugger for example)?
17427
I'm porting a module that currently works with Blocks/BlockForms to Paragraphs/NodeForms. I'm inserting an embedded form inside a Paragraph inside a Node Edit page using a hook_field_widget_entity_reference_paragraphs_form_alter. The general structure where the form gets inserted is: $form['field']['widget'][0]['settings'][form here]  After this the form displays as expected on the node edit page. The inserted form goes through a number of #process steps. The element in question is a select form that when the button underneath it is pressed, is supposed to retrieve some data via a custom submit handler and place it on the page with ajax:  The array for this element looks like this:  You can see the custom submit handler that is supposed to fire when 'Select Segment Set' is pressed After debugging, I've found that the entire NodeForm appears to be submitted to the backend, and the only handler that is found is from some other field that uses ajax. In short 'updateSegmentSet' is never discovered as a submit handler. When I debug the original module based on block/blockforms, I do see the correct submit handler being discovered. Now in the latter case, of course a blockForm is submitted to the back end with the correct plugin. Given that this is basically a form within a form within a form, is there something special I have to do to get the custom submit handler to run? I've read a few things online e.g. the 'settings' key and '#tree' = true. EDIT The Ajax property looks like this:       '#ajax' =&gt; [         'callback' =&gt; [$this, 'updateSegmentSetAjax'],         'wrapper' =&gt; $wrapper_id,       ],    public function updateSegmentSetAjax(array &amp;$form, FormStateInterface $form_state) {     $button = $form_state-&gt;getTriggeringElement();     // Go one level up in the form, to the widgets container.     return NestedArray::getValue($form, array_slice($button['#array_parents'], 0, -2));   }  As best I can tell, this is never called either.
16238
How do I escape a backtick ` within a code block?  This is probably a duplicate, since I'm sure it's a common concern, but I can't find a question that addresses this specifically.  How do I write List'1 with the "1" character still in the code-text format?
105202
How to install latest Code::Blocks using codeblocks_17.12-1_amd64_stable.tar.xz?  Software center has an old version and I am not able to configure. How to install? Why is there no documentation for installing?
96866
I'm using Drupal 8.  What I'm trying to do is:   Access the active node From the node get the value of field_test and assign it to a variable Pass the variable to the drupalSettings function and subsequently to a custom module 'mycustommodule' that triggers an alert   In my content type, I created a field_test field, which is the field I reference in my code. The block is placed on a page of this content type.  This is the code I am using.  mycustomblock.libraries.yml  custom:   version: 1.x   js:     js/custom.js: {}   dependencies:     - core/jquery     - core/drupalSettings   MyCustomBlock.php  &lt;?php /**  * @file  *  */  namespace Drupal\mycustomblock\Plugin\Block; use Drupal\Core\Block\BlockBase;  /**  * Creates a 'Foobar' Block  *  * @Block(  * id = "block_mycustomblock",  * admin_label = @Translation("MyCustomBlock"),  * category = @Translation("Blocks")  * )  */ class MyCustomBlock extends BlockBase {   /**    * {@inheritdoc}    */    public function build() {    // get the variable from field_test   if ($node = \Drupal::routeMatch()-&gt;getParameter('node')) {       $test = $node-&gt;field_test-&gt;value;       $variables['#attached']['library'][] = 'mycustomblock/custom';        $build['#attached']['drupalSettings']['mycustomblock']['test'] = $test;     } }   custom.js  (function ($, Drupal, drupalSettings) {   var testMe = Drupal.settings.mycustomblock.test;   alert(testMe); )(jQuery, drupalSettings);   How can I tell if the JavaScript file is being loaded from the block? I checked in the inspector, and do not see it being loaded when the page with the block on it loads.  Furthermore, how can I properly access the field value and pass it to JavaScript?
38464
In D6, I use a contrib module, but I would like to override a small bit of its behavior. I have a custom module for that, but my implementation of the relevant hook is called before the implementation in the contrib module, and so the contrib module's version "wins".   Is there any way to change it, and force my own hook to be called last?   Here are the specific details:  I would like to remove the default "Anonymous" user name for unregistered users in the comment form.  I created a small custom module, tweak_comment_form, that implements form_alter hook and removes the default value from the name field ().  However I also use a contrib module called , which also implements form_alter. RealName does what I want for registered users (replaces user name with "real name"), but re-assigns default value to the name field.
95520
I want to label a scale based on a variable value and I wrote a metapost code like this.  $ := 1; for i = -.3cm step .6cm until 3.6cm:     label.bot(str$,(i,-3.7cm));     $ := incr($); endfor;   It just labels "$" instead of its value. How to output the variables value?