Categories
CMS Drupal Mastering Development

How to upload multiple files in a custom form with Form API

I have a custom form created with Form API. In this form, I have a file field with the type managed_file $form[‘fichiers_justificatif’] = array( ‘#type’ => ‘managed_file’, ‘#title’ => ‘justificatifs’, ‘#upload_validators’ => $validators, ‘#upload_location’ => ‘private://justificatifs’, ‘#multiple’ => TRUE, ‘#description’ => ‘types de fichier autorisés : png gif jpg jpeg pdf doc’, ); It works […]

Categories
Mastering Development

Error in .getReactiveEnvironment()$currentContext: Operation not allowed without an active reactive context

I want to build a reactive plot in R shiny. The plot should count the number of rows with variable creadate having a certain value. The data that will feed in will be filtered by the selection of employeeName, typeName, and date. I write the following: library(shiny) library(shinyWidgets) library(tidyverse) data <- tibble(employee = c("John", "Mary", […]

Categories
Mastering Development

Laravel Ajax Select2 Search

my search is not working, it seems like script doesn’t call route at all.. Well, actually select2 is working, but it always says no results. any ideas?.. Controller (Dizainas5Controller): public function fetch(Request $request) { $data = []; if($request->has(‘q’)){ $search = $request->q; $data =Ikonos::select("id","ikona") ->where(‘ikona’,’LIKE’,"%$search%") ->take(5)->get(); } return response()->json($data); } Route: Route::get(‘/main/d5/fetch’, ‘Dizainas5Controller@fetch’)->name(‘d5.fetch’); Select: <select class="itemName […]

Categories
Mastering Development

Symfony – ManyToMany – replaces instead of adding

I apologize in advance if my question seems silly to you, I’m a beginner, I’ve searched but I can’t find the answers. We are in a factory. In this factory, each worker can have several posts, and each posts can contain several workers. So we are in a ManyToMany relationship. The problem is that when […]

Categories
Mastering Development

How to properly execute ajax no refresh in Rails

So I am trying to do a no refresh page ajax on delete Active storage images. Basically on my rooms_controller.rb I have this code for delete attachment: def delete_image_attachment @image = ActiveStorage::Attachment.find_by(params[:id]) @image&.purge) respond_to do |format| format.js end end As you can see I place this format.js expecting that it will do the trick when […]

Categories
Mastering Development

Can Shiny pass parameters list whose element is vector to Rmd

Another Shiny connected to reporter problem bothers me! I wonder if when shiny pass parameters list to R-reporter , one element of list is vector,like this: params <- list(n = c(‘img1’,’img2)) rmarkdown::render(tempReport, output_file = file, params = params, envir = new.env(parent = globalenv()) I want to do this,because I have code below: suppressPackageStartupMessages(library(shiny)) suppressPackageStartupMessages(library(readxl)) suppressPackageStartupMessages(library(ggplot2)) […]

Categories
Mastering Development

Symfony 4 input fields are not rendered

I’m currently strugglin with rendering of my form type. I have an Order entity and OrderItems entity, which both have their own Type. OrderType: <?php namespace App\Form; … class OrderType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add(‘customerName’, TextType::class, [‘label’ => ‘Jméno a příjmení’]) … ->add(‘orderItems’, CollectionType::class, [ ‘entry_type’ => OrderItemType::class, […]

Categories
Mastering Development

Shiny update table content based on pickerinput selection

This is my first time using shiny. I built a database to feed an existing app. the new module I created (by modifying a by_country page one is too complex) and is not fully working. The table "tablepreped.xlsx" is displaying and so are the drop-down menus but the filtering of the table is not updating […]

Categories
CMS Mastering Development Wordpress

Multiple Select on Gutenberg Sidebar as metakey

I want to show a multiple select element in the sidebar when editing a page in admin, where I can save the selected values in a metakey. Of course also load the selected values upon load of page-edit in admin. I manage to show the list, but I don’t know how to save it i […]

Categories
CMS Drupal Mastering Development

Drupal 7 creating a form field to upload multiple images

I’m creating a from in a custom Drupal 7 module with a field for multiple images, which isn’t working as expected. As an experiment, I added a custom field to the user acct settings of type image with multiple values. That form displays thumbnails of the uploaded images and has a new "add a new […]