Drupal 7 Views: How to sort the fields in the Views table programmatically with hook_views_default_views ()

I've created all the view configurations and exported the views_default.inc. After reimporting my custom module, the fields in the sort table do not work and need to be manually configured again. I want all the sort configuration to be done through the code so that I do not have to do it from the administrator.

        $ view = new view ();
$ view-> name = & # 39; calendar & # 39 ;;
$ view-> description = & # 39 ;;
$ view-> tag = & # 39; Calendar of Events & # 39 ;;
$ view-> base_table = & # 39; node & # 39 ;;
$ view-> human_name = & nbsp; Calendar of Events & nbsp ;;
$ view-> core = 7;
$ view-> api_version = 3.0 & # 39 ;;
$ view-> disabled = FALSE; / * Change this to true to make a default view disabled initially * /

/ * Posting: Master * /
$ handler = $ view-> new_display ('default', 'Master', & # 39; default & # 39;) & # 39;
$ handler-> display-> display_options['use_more_always'] = FALSE;
$ handler-> display-> display_options['link_display'] = & # 39; page_1 & # 39 ;;
$ handler-> display-> display_options['access']['type']    = & # 39; perm & # 39;
$ handler-> display-> display_options['cache']['type']    = & # 39;
$ handler-> display-> display_options['query']['type']    = & # 39; views_query & # 39 ;;
$ handler-> display-> display_options['query']['options']['query_comment']    = FALSE;
$ handler-> display-> display_options['exposed_form']['type']    = & # 39; basic & # 39;
$ handler-> display-> display_options['pager']['type']    = & # 39; date_views_pager & # 39 ;;
$ handler-> display-> display_options['pager']['options']['date_id']    = & # 39; month & # 39 ;;
$ handler-> display-> display_options['style_plugin'] = & # 39; table & # 39 ;;

/ * Sort criteria: Content: Title * /
$ handler-> display-> display_options['sorts']['title']['id']    = & # 39; title & # 39 ;;
$ handler-> display-> display_options['sorts']['title']['table']    = & # 39; node & # 39 ;;
$ handler-> display-> display_options['sorts']['title']['field']    = & # 39; title & # 39 ;;
$ handler-> display-> display_options['sorts']['title']['order']    = & # 39; ASC & # 39 ;;

/ * Sort criteria: Content: Start date * /
$ handler-> display-> display_options['sorts']['event_start_date']['id']    = & # 39; event_start_date & # 39 ;;
$ handler-> display-> display_options['sorts']['event_start_date']['table']    = & # 39; node & # 39 ;;
$ handler-> display-> display_options['sorts']['event_start_date']['field']    = & # 39; event_start_date & # 39 ;;
$ handler-> display-> display_options['sorts']['event_start_date']['order']    = & # 39; ASC & # 39 ;;

/ * Sort criteria: Content: End date * /
$ handler-> display-> display_options['sorts']['event_end_date']['id']    = & # 39; event_end_date & # 39 ;;
$ handler-> display-> display_options['sorts']['event_end_date']['table']    = & # 39; node & # 39 ;;
$ handler-> display-> display_options['sorts']['event_end_date']['field']    = & # 39; event_end_date & # 39 ;;
$ handler-> display-> display_options['sorts']['event_end_date']['order']    = & # 39; ASC & # 39 ;;

/ * Field: Content: Title * /
$ handler-> display-> display_options['fields']['title']['id']    = & # 39; title & # 39 ;;
$ handler-> display-> display_options['fields']['title']['table']    = & # 39; node & # 39 ;;
$ handler-> display-> display_options['fields']['title']['field']    = & # 39; title & # 39 ;;
$ handler-> display-> display_options['fields']['title']['label']    = & # 39; Event Title & # 39 ;;
$ handler-> display-> display_options['fields']['title']['link_to_node']    = FALSE;

/ * Field: Content: Start date * /
$ handler-> display-> display_options['fields']['event_start_date']['id']    = & # 39; event_start_date & # 39 ;;
$ handler-> display-> display_options['fields']['event_start_date']['table']    = & # 39; field_data_event_start_date & # 39 ;;
$ handler-> display-> display_options['fields']['event_start_date']['field']    = & # 39; event_start_date & # 39 ;;
$ handler-> display-> display_options['fields']['event_start_date']['settings']    = table (
& # 39; format_type & # 39; => & # 39; short
& # 39; custom_date_format & # 39; => & # 39;
& # 39; fromto & # 39; => & Nbsp; both
& # 39; multiple_number & # 39; => & # 39;
& # 39; multiple_from & # 39; => & # 39;
& # 39; multiple_to & # 39; => & # 39;
& # 39; show_remaining_days & # 39; => 0,
)
/ * Field: Content: End date * /
$ handler-> display-> display_options['fields']['event_end_date']['id']    = & # 39; event_end_date & # 39 ;;
$ handler-> display-> display_options['fields']['event_end_date']['table']    = & # 39; field_data_event_end_date & # 39 ;;
$ handler-> display-> display_options['fields']['event_end_date']['field']    = & # 39; event_end_date & # 39 ;;
$ handler-> display-> display_options['fields']['event_end_date']['settings']    = table (
& # 39; format_type & # 39; => & # 39; short
& # 39; custom_date_format & # 39; => & # 39;
& # 39; fromto & # 39; => & Nbsp; both
& # 39; multiple_number & # 39; => & # 39;
& # 39; multiple_from & # 39; => & # 39;
& # 39; multiple_to & # 39; => & # 39;
& # 39; show_remaining_days & # 39; => 0,
)
/ * Filtering criteria: Content: Posted * /
$ handler-> display-> display_options['filters']['status']['id']    = & # 39 ;; status;
$ handler-> display-> display_options['filters']['status']['table']    = & # 39; node & # 39 ;;
$ handler-> display-> display_options['filters']['status']['field']    = & # 39 ;; status;
$ handler-> display-> display_options['filters']['status']['value']    = 1;
$ handler-> display-> display_options['filters']['status']['group']    = 0;
$ handler-> display-> display_options['filters']['status']['expose']['operator']    = FALSE;
/ * Filtering criteria: Content: Type * /
$ handler-> display-> display_options['filters']['type']['id']    = & # 39; type & # 39;
$ handler-> display-> display_options['filters']['type']['table']    = & # 39; node & # 39 ;;
$ handler-> display-> display_options['filters']['type']['field']    = & # 39; type & # 39;
$ handler-> display-> display_options['filters']['type']['value']    = table (
& # 39; msd_calendar & # 39; => & # 39; msd_calendar & # 39;
)
/ * Display block * /
$ handler = $ view-> new_display ('block', 'Block', 'block_1');
$ handler-> display-> display_options['defaults']['use_ajax']    = FALSE;
$ handler-> display-> display_options['use_ajax'] = TRUE;
$ handler-> display-> display_options['defaults']['hide_admin_links']    = FALSE;
$ handler-> display-> display_options['defaults']['pager']    = FALSE;
$ handler-> display-> display_options['pager']['type']    = & # 39; date_views_pager & # 39 ;;
$ handler-> display-> display_options['pager']['options']['date_id']    = & # 39; mini & # 39 ;;
$ handler-> display-> display_options['defaults']['style_options']    = FALSE;
$ handler-> display-> display_options['defaults']['row_plugin']    = FALSE;
$ handler-> display-> display_options['defaults']['row_options']    = FALSE;
$ handler-> display-> display_options['defaults']['arguments']    = FALSE;
$ handler-> display-> display_options['defaults']['filter_groups']    = FALSE;
$ handler-> display-> display_options['defaults']['filters']    = FALSE;
/ * Filtering criteria: Content: Posted * /
$ handler-> display-> display_options['filters']['status']['id']    = & # 39 ;; status;
$ handler-> display-> display_options['filters']['status']['table']    = & # 39; node & # 39 ;;
$ handler-> display-> display_options['filters']['status']['field']    = & # 39 ;; status;
$ handler-> display-> display_options['filters']['status']['value']    = 1;
$ handler-> display-> display_options['filters']['status']['group']    = 1;
$ handler-> display-> display_options['filters']['status']['expose']['operator']    = FALSE;
/ * Filtering criteria: Content: Type * /
$ handler-> display-> display_options['filters']['type']['id']    = & # 39; type & # 39;
$ handler-> display-> display_options['filters']['type']['table']    = & # 39; node & # 39 ;;
$ handler-> display-> display_options['filters']['type']['field']    = & # 39; type & # 39;
$ handler-> display-> display_options['filters']['type']['value']    = table (
& # 39; msd_calendar & # 39; => & # 39; msd_calendar & # 39;
)
$ handler-> display-> display_options['filters']['type']['group']    = 1;
/ * Filtering criteria: Content: Start date (event_start_date) * /
$ handler-> display-> display_options['filters']['event_start_date_value']['id']    = & # 39; event_start_date_value & # 39 ;;
$ handler-> display-> display_options['filters']['event_start_date_value']['table']    = & # 39; field_data_event_start_date & # 39 ;;
$ handler-> display-> display_options['filters']['event_start_date_value']['field']    = & # 39; event_start_date_value & # 39 ;;
$ handler-> display-> display_options['filters']['event_start_date_value']['operator']    = & # 39;> & # 39 ;;
$ handler-> display-> display_options['filters']['event_start_date_value']['group']    = 1;
$ handler-> display-> display_options['filters']['event_start_date_value']['expose']['operator_id']    = & # 39; event_start_date_value_op & nbsp;
$ handler-> display-> display_options['filters']['event_start_date_value']['expose']['label']    = & # 39; Start Date (event_start_date) & # 39 ;;
$ handler-> display-> display_options['filters']['event_start_date_value']['expose']['operator']    = & # 39; event_start_date_value_op & nbsp;
$ handler-> display-> display_options['filters']['event_start_date_value']['expose']['identifier']    = & # 39; event_start_date_value & # 39 ;;
$ handler-> display-> display_options['filters']['event_start_date_value']['default_date']    = & 12 hours today;;
$ handler-> display-> display_options['block_description'] = & # 39; System failures & # 39 ;;
$ translatable['calendar'] = table (
t ("Master"),
t (plus' #),
t ("Apply"),
t (& # 39; Reset & # 39;),
t (& # 39; Sort by & # 39;),
t ('Asc'),
t ("Desc & # 39;),
t ("Event Title"),
t ('Start date'),
t ('End date'),
t ('Start date (event_start_date)'),
t (& # 39; Block & # 39;),
t ("system failures"),
)

$ views[$view->name] = $ view;
returns $ views;

settings.php – Get the PHP extension "gd" and the error disabled database support during the installation of Drupal 8

I'm trying to install Drupal 8.7.3 on my Windows machine via Xampp (PHP 7.3.6). But I receive the following errors:

Please see the screen capture:
https://snag.gy/06sMEa.jpg

I tried to do the following but I could not solve it:

1- I've copied php.ini to the root of my drupal folder and made sure the extensions are enabled. and I made sure that the default php.ini has the same extensions enabled.
Please see the screenshot: https://snag.gy/nN8BGA.jpg

2- I have also downloaded the php_gd2.dll and php_gd.dll files and have them also placed in the / ext folder. please see the screenshot: https://snag.gy/RHqrlI.jpg

My problem remains the same. Can you help me solve this problem.

Here is my result phpinfo () on the extensions:
https://snag.gy/ifsIjo.jpg

See also the path of the extension:
https://snag.gy/Jlcw01.jpg

migration – Migrating the csv date field to Drupal 8 using format_date

tried to import the date fields from a CSV file to Drupal 8 using the format_date function. followed these two answers
Import a CSV Date in the Date field
How to convert year to date with Migrate

but did not work for me. he continues to translate everything in 1969/12/31 19:33. Does anybody know why?

here is my YAML file where field_date is the name of the machine in the date field of my content type, and Date is the name of the field in CSV. and the date format in CSV format looks like 12/22/12 12:22

date of the field:
plugin: format_date
from_format: m / j / y H: i & # 39;
to_format: Y-m-d TH: i: s & # 39;
source: date

[WTS] Web Hosting Plans # 1 | DailyRazor.com

Do you need a reliable and ultra fast web hosting on Linux and Windows?

DailyRazor.com is a professional web hosting provider and other web services such as domain names, ecommerce, web design, search engine optimization and marketing, charts and consulting for small businesses and individuals around the world.

We have more than 15 years of combined experience in Java, .NET, PHP, Ruby, CGI, network administration, systems integration and related technologies to support the & # 39; Critical hosting for applications developed on these platforms. In addition, we offer web hosting packages to support common technologies such as Perl, Python, and Ruby, as well as databases for the ever-growing and popular Microsoft Access, Microsoft SQL Server, MySQL, and MySQL databases. PostgreSQL.

Our features:

  • Professional support 24/7
  • 30-day money back guarantee
  • 99.9% uptime guarantee
  • Fast and fast server infrastructure
  • 1-Click App Install (hundreds of choices)
  • Award-winning Web Hosting
  • More than 15 years of experience in Linux and Windows hosting

Our Web hosting plans are designed to help your website succeed! We offer an instant installation software called Softaculous that allows you to automatically install over 276 open-source scripts at the click of a mouse. You can install WordPress, Joomla, Opencart, PrestaShop, phpBB, Drupal, SMF, MyBB, Magento, Dolphin, Open Blog, TextPattern, LifeType, etc. with one click!

Note: Each hosting plan comes with: disk space, bandwidth, email accounts, FTP accounts as much as you need + FREE domain name.

Dailyrazor also offers Tomcat hosting, Joomla hosting, OpenCart hosting, vBulletin hosting Solutions!

Use the code: SUPERSHARED and get up to 60.40% discount on all accommodation plans!

Entrance
1 site / domain
10 databases
Domain FREE Domain
FREE Website Builder
FREE SSL security
CPanel Control Panel
$ 3.15 / month 60.40% discount (cost $ 7.95) – ORDER NOW
Click here for more plans and details: https://www.dailyrazor.com/web-hosting/

Our ASP.NET top hosting plans are designed to help your website succeed!
Use the code: SUPERSHARED and get up to 60.40% discount on all accommodation plans!

Entrance
1 site / domain
10 databases
Domain FREE Domain
FREE Website Builder
FREE SSL security
CPanel Control Panel
$ 3.94 / month Discount of 60.40% (was $ 9.95) – ORDER NOW
Click here for more plans and details: https://www.dailyrazor.com/asp-net-hosting/

Our Ultimate Reseller Hosting plans are designed to help your website succeed!
Use the code: SUPERRESELL and get up to 10% DISCOUNT on all reseller hosting plans!

Bronze
Host unlimited domains / websites
25 GB of disk space
250 GB transfer / bandwidth
WHM / cPanel Control Panel
$ 11.65 / month 10.00% discount (was $ 12.95) – ORDER NOW
Click here for more plans and details: https://www.dailyrazor.com/reseller-hosting/

Our ColdFusion Expert Hosting plans are designed to help your website succeed!
Use the code: CFPRIMO and get up to 50% DISCOUNT on all ColdFusion hosting plans!

CF-One
1 site / domain
1 MS SQL database
5 MySQL databases
Free domain name
Plesk Control Panel
$ 7.98 / month 50% discount ($ 15.95) – ORDER NOW
Click here for more plans and details: https://www.dailyrazor.com/coldfusion-hosting/

We also offer a 1-Click Application installer integrated into our Plesk control panel, which allows you to automatically install tons of open-source scripts at the click of a mouse. You can install WordPress, Joomla, Opencart, PrestaShop, phpBB, Drupal, SMF, MyBB, Magento, Dolphin, Open Blog, TextPattern, LifeType, etc. with one click!

Our guarantee:
Try one of our FREE hosting packages for 30 days! We will let our quality service speak for us and if you are not satisfied with our service, simply contact us to cancel before or the 30th day and we will be happy to refund your deposited funds without any question asked!

If you have any questions, do not hesitate to contact our support: Send the ticket

Like DailyRazor THE FACEBOOK PAGE
Follow DailyRazor via TWITTER ACCOUNT

.

How to display custom data from the Drupal database in a view?

I'm working on creating a new website in Drupal 8 and I do not know how to reference custom table data in a view.

Specifically, I have a script that extracts data from an external database and inserts it into my Drupal database in custom tables. How can I allow Views to see this data?

In Drupal 7, I've already used the Forena module and the Data and Schema modules to achieve the same database and external references, but what I'm seeing is that the support for these three modules in Drupal 8 seems to be missing, which suggests to me that In D8, there is a better way to do it than everyone knows except me. 🙂

I'm not sure I'm not searching properly, but I'm unable to find a clear answer on how to get this feature in Drupal 8. Drupal 8 is so different and I'm not sure if I need to do it. be looking for a contributory module or if it's something I would code directly.

Hope someone can direct me in the right direction?

Drupal 8 on Acquia – no way to install or add libraries?

It's been 3 days that I'm trying to set up a site on Acquia, and I'm puzzled. Acquia does not support Composer, Acquia Dev Desktop does not synchronize libraries. I tried Ludwig without success. Is there a way to add CSV / League libraries to Acquia? Without this ability, I am not sure of the usefulness of Acquia, or is it missing something simple?

TIA!

Drush tail has stopped working – Drupal Answers

Using Drush 5.9, Drupal 7.67, PHP 7.1.22 – have not updated anything for a few weeks, but last Thursday, wd-show – stopped working for me. This is both on my local (MAMP) and delete (on Google Cloud). If I type
drush @project wd-show
I see the last ten lines but with
drush @project wd-show –tail

I see Unable to change header information – Headers already sent by bootstrap.inc:1503

I've seen in the past, but nothing after.

theme settings – Drupal 8 selection, storage, custom font caching

I would like you to talk about font paths and font caching in Drupal 8 (8.7.2).

My goal is to use a custom font without using the @ font-your-face-face module.

Just to try, on my local installation, I added the font family to line 17 of core / themes / bartik / css / components / site-branding.css

At this point, my font file resides in my computer's folder, the Drupal chachage is disabled.

In fact, the font is displayed correctly – no need to put the font file in a drupal directory, no need to set a path to the font file.

How can this work? How does Drupal know where to shoot the police?

Even stranger, fonts remain correctly displayed even after deleting the desktop font file and removing the cache in Drupal.

Can anyone understand how Drupal extracts and stores fonts?

Thank you very much in advance

Equivalence of the elysa cron module on drupal 8?

I am a beginner in D8, I would like to know if there is an equivalence of Elysia Cron module to manage cron on Drupal 8

virtual machine – How can I change drupal_core_path to / public instead of / web in Drupal VM?

I use Drupal VM to build my VM.

I need to change the folder drupal_core_path: "{{drupal_composer_install_dir}} / web" to drupal_core_path: "{{drupal_composer_install_dir}} / public"

But if I run vagabond I receive this error:

An exception occurred while running the task. To see complete tracking, use -vvv. The error was: OSError: [Errno 2] No such file or directory: / var / www / jb-inflatables / public & # 39;
fatal: [jb-inflatables]: FAILED! => {"changed": false, "failed_when_result": true, "module_stderr": "Traceback (the most recent call last):  n File " / home / vagrant / .ansible / tmp / ansible -tmp-1560461183.6. - 73909259621121 /AnsiballZ_command.py  ", line 114, in  n _ansiballz_main ()  n File  "/ home / vagrant / .ansible / tmp / ansible-tmp-1560461183.6 - 73909259621121 / AnsiballZ_command.py ", line 106, in _ansiballz_main  n invoke_module (zipped_mod, temporary image). n File  "/ home / vagrant / .ansible / tmp / ansible-tmp-1560461183.6-73909259621121 / AnsiballZ_command.py ", line 49, in invoke_module  n imp.load_module (__ hand __, module , module, MOD_DESC) n File  "/ tmp / ansible_command_payload_KaNSZF / __ hand __. py ", line 327, in File  "/ tmp / ansible_command_payload_KaNSZF / __ hand __. py ", line 263, in main  nOSError: [Errno 2] No such file or directory: / var / www / jb-inflatables / public & # 39;  n "," module_stdout ":" "," msg ":" MODULE FAILURE  n. See stdout / stderr for the exact error "," rc ": 1

How should I change config.yml so that Drupal is installed in / Public instead of / web?