I am able to render the entity browser button in custom configuration form. But, after selecting the image it does not get displayed in the  form, has anyone integrated in custom form so far ?  $form['content_link'] = [     '#type' =&gt; 'container',     '#parents' =&gt; ['content_link_wrapper'],     '#weight' =&gt; -3,     'widget' =&gt; [       '#title' =&gt; t('Content Link'),       '#description' =&gt; t('The content to be linked in the menu.'),       '#field_name' =&gt; 'content_link',       '#field_parents' =&gt; [],       '#required' =&gt; TRUE,       '#parents' =&gt; ['content_link'],       '#tree' =&gt; TRUE,       '#id' =&gt; 'edit-content-link',       '#type' =&gt; 'details',       '#open' =&gt; TRUE,       'target_id' =&gt; [         '#type' =&gt; 'hidden',         '#id' =&gt; 'edit-content-link-target-id',         '#attributes' =&gt; [           'id' =&gt; 'edit-content-link-target-id',         ],         '#default_value' =&gt; "",         '#ajax' =&gt; [           'callback' =&gt; [             '\Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget',             'updateWidgetCallback',           ],           'wrapper' =&gt; 'edit-content-link',           'event' =&gt; 'entity_browser_value_updated',         ],       ],       'entity_browser' =&gt; [         '#type' =&gt; 'entity_browser',         '#entity_browser' =&gt; 'image_browser_dropzonejs',         '#cardinality' =&gt; 1,         '#selection_mode' =&gt; 'selection_append',         '#default_value' =&gt; [],         '#custom_hidden_id' =&gt; 'edit-content-link-target-id',         '#process' =&gt; [           [             '\Drupal\entity_browser\Element\EntityBrowserElement','processEntityBrowser'           ],         ],       ],       'current' =&gt; [         '#theme_wrappers' =&gt; ['container'],         '#attributes' =&gt; [           'class' =&gt; 'entities-list',         ],         'items' =&gt; [],       ],       '#attached' =&gt; [         'library' =&gt; [           'entity_browser/entity_reference',         ],       ],     ],   ];
I am having trouble adding an image picker to a block form defined in a custom module.  If I create a custom block type I can define an image field as entity_reference and in the block's form view tell it to use entity_browser and media_entity_browser.  This provides me with an picker with which I can select my image:    I am trying to recreate this in a block provided by my custom module, without much success  // /src/Plugin/Block/MyCustomBlock.php  function blockForm($form, FormStateInterface $form_state)  {     ...      $form['image'] = [       '#type' =&gt; 'entity_browser',       '#entity_browser' =&gt; 'media_entity_browser',       '#title' =&gt; $this-&gt;t('Image'),       '#default_value' =&gt; $this-&gt;configuration['image'] ?? null,       '#weight' =&gt; '0',     ];      ... }   This gives me the following.  Note the lack of the bounding box, title and option to edit remove items:     Exporting the configuration files for the working form view gets me this:  // core.entity_form_display.block_content.lead_block.default.yml      ...  field_image:     weight: 1     settings:       entity_browser: media_entity_browser       field_widget_display: rendered_entity       field_widget_edit: true       field_widget_remove: true       selection_mode: selection_append       field_widget_display_settings:         view_mode: default       open: false     third_party_settings: {  }     type: entity_browser_entity_reference     region: content   ...   But if I try and use 'type' =&gt; 'entity_browser_entity_reference' in my blockForm function the field disappears altogether.  Looking into various core files I can see that entity_browser is a @FormElement and entity_browser_entity_reference is a @FieldWidget but I don't really understand the difference.  As you might guess I am fairly new to Drupal and I feel like I am missing something fundamental.  I (think I) understand that custom block types are actually nodes internally and that they are subject to different rules to blocks which I define in my custom modules, but I don't fully grasp what the differences here are.  Is is it possible to use the entity browser in my custom module block form in the same way as it is used in the form which I build through the admin's custom block type builder?  Thank you.
Execute a script upon logout/reboot/shutdown in Ubuntu I'd like to run a .sh file using bash on logout and shutdown of Ubuntu. I have searched up and down the web and have found only fixes for KDE and GNOME. The script is simple, I just need to know if I can add the line of code to the "logoff/shutdown" file or if I need to reference it in another script. I'm at a loss with “Dungeons and Dragons.” How does one play it, anyway? I'm no gamer at all, so this could be like a very silly, basic question for you guys. The thing is that I always read about "Dungeons and Dragons" game (not the video game, but the normal game to play with friends that are actually gathered together). And I would like to know how to play it.  I've read that it is a book (or several ones, which is more confusing for me to understand), but I've read somewhere that it can be played as a normal "table" game, with a board, and pieces, and somewhat weird dice (or sets of dice).  Is it like a normal game, where you pull the stuff out of a box and start to play?  I don't know if any of you watch the show "The Big Bang Theory", but I think they have played the game in a recent episode, and it looks just like a regular game.  I've Googled it for more information, but I haven't found anything as basic as I need, because I've never played a role game (except in a video game).  I just want to learn how to play, so I can get my friends into it to play it each time we get together. Showing current taxonomy terms I've created a custom post type called "References" and a custom taxonomy "Genre".  I have 2 terms : Applications and Games.  My problem is that I'd like to show posts associated in Applications on a page (and the same for the games). I believe WordPress do this like doing the same for tags....  In fact, I just need to make a query and getting the current term of the page.  Here is what I tried but I get the same list for each terms page (Applications and Games) :  &lt;?php get_header(); ?&gt;           &lt;div class="container" role="main"&gt;                              &lt;h1 class="entry-title"&gt;&lt;?php single_cat_title(); ?&gt;&lt;/h1&gt; &lt;div class="entry-content ref"&gt;     &lt;?php      $loop = new WP_Query( array( 'post_type' =&gt; 'references' , 'genre' =&gt; '') ); ?&gt;     &lt;?php while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); ?&gt;          &lt;div id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class(); ?&gt;&gt;                  &lt;h2 class="entry-title"&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;                  &lt;div class="ref"&gt;&lt;?php the_content(); ?&gt;&lt;/div&gt;          &lt;/div&gt;&lt;!-- #post-## --&gt;          &lt;?php the_post_thumbnail();?&gt;      &lt;?php endwhile; // end of the loop. ?&gt;  &lt;/div&gt;&lt;!-- .entry-content --&gt;           &lt;/div&gt;&lt;!-- #container --&gt;  &lt;?php get_footer(); ?&gt;   Hope someone can help me. I've Googled for a week now... Does a gluon have mass or not? I was under the impression that gluons had no mass. Then Wikipedia throws this curveball:  Mass: 0 (theoretical value) &lt; 0.0002 eV/c2 (experimental limit)  Which one should a poor soul go by? If the theoretical value just the one that people &quot;thought&quot; was right, until they found out the truth, or is the experimental limit(?) an impossibility that still has not been explained? Or something third? How long can eggs be unrefrigerated before becoming unsafe to eat? A friend of mine accidentally left a carton of eggs on her counter, unrefrigerated, for three days. The eggs had been previously refrigerated both at the store and at home. Now she's planning to do some more cooking which requires eggs, and is wondering if it's still safe to use them for baking. I believe she is planning on baking cookies with them, so they would be baked at fairly high temperatures for probably at least 10 minutes. Would this be safe, or are eggs left unrefrigerated for that long not safe for consumption? When to use self references or composition? Electrolytic Capacitor Voltage Rating vs capacitance I have always believed that it was ok to replace a capacitor with a slightly higher voltage rated one. eg 16v with 25v.Going higher than this would risk the capacitance value being out at the working voltage. However I just read the following quote from this       Electrolytic capacitors are non-ferroelectric with a very low dielectric constant. Their capacitance is derived from a very high surface area and nanometer thick dielectric layers. Their capacitance is not a function of applied voltage.‐Design Solutions For DC Bias In Multilayer Ceramic Capacitors (August 2010 Electronic Engineering Times)   So does this rule not apply to aluminum electrolytics? Eg will I have no issues replacing an electrolytic 25v 100uf with a 50v 100uf assuming both are low esr, similar footprint and good quailty? What iron-clad reason did Dumbledore have for believing Snape was on his side I have a new laptop which I am setting up as dual boot Windows/Linux.    I would like to access files from both Ubuntu and Windows 7.  Should I create a separate NTFS partition? What factors determine enemy levels or: How do enemy levels scale to the player character's? When I finished Normal Mode at around Level 30 and went back to the  (still at Normal mode), I found that all enemies there are now very easy to kill, meaning they didn't level up (or hit a level cap).  When I went to  as a Level 36 character in True Vault Hunter Mode, I noticed that the enemies are the same level as me.  What factors determine enemy levels?   Specifically, I would like to know:       Are enemies affected by what level a character accepted a mission?      Or is it what level a character is when they first entered an area?      How does Normal Mode, True Vault Hunter mode, and the Ultimate True Vault Hunter Mode affect enemy levels?     Are there enemies that will scale to the player level, as the player levels up? Any enemy leveling differences specific to the DLC areas?         EDIT:   There is now  that explains how this works generally: "In playthrough 1, outside of the DLC, there's no such thing as scaling. Enemy levels are determined solely by the area they're in and your mission." Can anyone expound on that, and comment or provide an answer on what are the specific enemy levels on specific areas and/or missions?    states that "enemies do not actually "scale", or at least from what we know of..." and lists specifics for enemy levels on certain areas in the game (sans DLC areas). Can anyone expound on that and/or add specifics for enemy levels in the DLC missions or areas in TVHM (PT 2.0) and/or UTVHM? The  update has just been released, can anyone provide info about enemy levels on that mode, including the DLC areas or missions? Is it acceptable to vote to close a question without leaving a comment? Although  is obviously an exceptionally poor question, it still amazes me that 5 people can vote to close and yet not one of them leave a comment to help explain how the poster can improve their question.  I see loads of similar examples where questions from new users are closed and heavily voted down without anyone taking any effort to explain why - not a pleasant experience for new users.  Is there anything that can be done to encourage users to leave comments when voting to close? Scanner is skipping nextLine() after using next() or nextFoo()? What's the limit of the sequence $\lim\limits_{n \to\infty} \frac{n!}{n^n}$? Difference between ' and " on command line (bash)? I used to use '' and "" (single and double-quotes) interchangeably on the command line, but I recently noticed that '$HOME/some/dir' is not expanded, while "$HOME/some/dir" is. I searched around a little bit and found that "" allows some protection of special characters, while '' allows full protection. So what other characters are protected by '' and not ""?  EDIT: What are practical situations in which these differences might be significant? X,Y,Z missing in F3 How to modify the system default background image I am about to ship a new 10.04 installed system to a customer. This is the 1st system that we are shipping with our preinstalled software and an additional hardware test platform, so I thought it would be a nice idea to have the desktop wallpaper include our company's logo.  What I want to do is just to add the logo to the default background image. the questions are:   Where are the set of backgrounds stored? What are the rules for creating a custom background from scratch? If I create a background from scratch, how do I add it to the system's background set (i.e., not just save it in the user's Pictures directory - I want it to be available to all future users of the machine)? How do I find out which DOM element has the focus? How do you make your own agar.io skins? I have noticed recently that people have their own skins. Not like the ones where you type in a specific nickname and it gives you a skin but where the people make their own. How do you do it? How to run two Thread Group in a loop - JMeter I'm facing problem here, There are 2 Thread Groups  and both are correlated ( run thread group consecutively is ticked in test plan ).  1st is user thread group and 2nd is Driver thread group. So thread group running concurrently but it is not happening in twice. I've put loop count for 2 they will run each independently after completion of first cycle. I want run this flow such a way that after completion of driver group request next do second iteration (start from user) thread group. So how to do this stuff ?  Loop will be :   User thread group Driver Thread group   After completing this once again start with :   User thread group Driver thread group   like this it should(loop) happen for multiple times How do I install GNOME Shell extensions?  Is it possible to update, remove and manage the extensions?