With first removing the .htaccess from the sync folder its working
so this is te working flow
dev drush config:export
and then copy the sync file to somwhere outside the dev so as not to add it to the git repo
open terminal and cd to that place
remove the .htacces from the sync folder
tar -czf config.tar.gz -C sync .
(cannot find what the -C is for)
load that config.tar.gz up to the UI in the server.
Import
Could not extract the contents of the tar file. The error message is File ../sync/./.htaccess already exists and is write protected
it seems to work now, i used
tar -czf config.tar.gz -C sync .
instead of
tar -cvzf config.tar.gz sync
But thanx for replying, i ll look into it a bit further
p.s.
Would you see any problem with this solution?
I have the same issue on een 9.5.11 site, unable to progress to 10 without this working...
Thanx for your suggestion. Thought so too.
I just never saw this transitive remark, and the site was supposed to be setup with composer so..... Thought maybe there is some extra composer second degree dependency that I am missing.
{
"name": "drupal/recommended-project",
"description": "Project template for Drupal 8 projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "
https://www.drupal.org/project/drupal →
",
"support": {
"docs": "
https://www.drupal.org/docs/user_guide/en/index.html →
",
"chat": "
https://www.drupal.org/node/314178 →
"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"composer/installers": "^1.9",
"drupal/address": "^1.8",
"drupal/addtoany": "^2.0",
"drupal/adminimal_theme": "^1.5",
"drupal/backup_migrate": "^5.0",
"drupal/better_exposed_filters": "^6.0",
"drupal/bootstrap4": "^2.0",
"drupal/config_filter": "^1.8",
"drupal/core-composer-scaffold": "^9",
"drupal/core-project-message": "^9",
"drupal/core-recommended": "^9",
"drupal/ctools": "^4.0",
"drupal/custom_breadcrumbs": "^1.0",
"drupal/devel": "^5.0",
"drupal/draggableviews": "^2.0",
"drupal/eu_cookie_compliance": "^1.11",
"drupal/extlink": "^1.3",
"drupal/field_group": "^3.1",
"drupal/focal_point": "1.x-dev",
"drupal/fontyourface": "^3.2",
"drupal/geocoder": "^3.29",
"drupal/geofield": "^1.15",
"drupal/geofield_map": "^3.0",
"drupal/geofield_mapbox_gl": "1.x-dev@dev",
"drupal/google_analytics": "^4.0",
"drupal/google_tag": "^2.0",
"drupal/inline_responsive_images": "^2.1",
"drupal/jquery_ui_datepicker": "^2.0",
"drupal/jquery_ui_slider": "^2.0",
"drupal/jquery_ui_tabs": "^2.0",
"drupal/jquery_ui_tooltip": "^2.0",
"drupal/media_library_edit": "^3.0",
"drupal/menu_block": "^1.6",
"drupal/metatag": "^1.14",
"drupal/paragraphs": "^1.12",
"drupal/pathauto": "^1.8",
"drupal/private_files_download_permission": "^3.0",
"drupal/redirect": "^1.6",
"drupal/schema_metatag": "^2.1",
"drupal/simple_recaptcha": "^1.0@beta",
"drupal/transliterate_filenames": "^2.0",
"drupal/upgrade_status": "^4.0",
"drupal/views_exposed_filter_blocks": "^1.1",
"drupal/views_geojson": "^1.0",
"drupal/views_slideshow": "^5.0",
"drupal/webform": "^6.0",
"drupal/webform_config_ignore": "^1.2",
"drupal/webform_translation_permissions": "^2.0",
"drush/drush": "^11.6",
"kint-php/kint": "^3.3"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true
}
},
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "web/"
}
},
"installer-paths": {
"web/core": [
"type:drupal-core"
],
"web/libraries/{$name}": [
"type:drupal-library"
],
"web/modules/contrib/{$name}": [
"type:drupal-module"
],
"web/profiles/contrib/{$name}": [
"type:drupal-profile"
],
"web/themes/contrib/{$name}": [
"type:drupal-theme"
],
"drush/Commands/contrib/{$name}": [
"type:drupal-drush"
],
"web/modules/custom/{$name}": [
"type:drupal-custom-module"
],
"web/themes/custom/{$name}": [
"type:drupal-custom-theme"
]
},
"drupal-core-project-message": {
"include-keys": [
"homepage",
"support"
],
"post-create-project-cmd-message": [
"<bg=blue;fg=white> </>",
"<bg=blue;fg=white> Congratulations, you’ve installed the Drupal codebase </>",
"<bg=blue;fg=white> from the drupal/recommended-project template! </>",
"<bg=blue;fg=white> </>",
"",
"<bg=yellow;fg=black>Next steps</>:",
" * Install the site:
https://www.drupal.org/docs/8/install →
",
" * Read the user guide:
https://www.drupal.org/docs/user_guide/en/index.html →
",
" * Get support:
https://www.drupal.org/support →
",
" * Get involved with the Drupal community:",
"
https://www.drupal.org/getting-involved →
",
" * Remove the plugin that prints this message:",
" composer remove drupal/core-project-message"
]
}
}
}
this is an easier way
function desocialebenadering_preprocess_field__nameofmyfield(&$vars)
{
$items = $vars['element']['#items'];
foreach ($items->getValue() as $delta => $item) {
// Depending on type
// $item['value'],
// $item['target_id'] etc.
$value = $item['value'];
// print_r($item);
}
// if it is a repeatable field
if (!$vars['multiple']) {
$vars['attributes']['class'][] = 'context-'.$value;
}
// otherwise
foreach(array_keys($vars['items']) as $delta)
{
$vars['items'][$delta]['attributes']->setAttribute('class', 'context-'.$value);
}
}
function desocialebenadering_preprocess_field__field_context_referred_organisat(&$vars) { $items = $vars['element']['#items']; foreach ($items->getValue() as $delta => $item) { // Depending on the field type you find the value in $item['value'], // $item['target_id'] etc. // $value = $item['value']; // print_r($item); // .... $value = $item['target_id']; } // if (!$vars['multiple']) { $vars['attributes']['class'][] = 'context-'.$value; // } // foreach(array_keys($vars['items']) as $delta) // { // // $vars['items'][$delta]['attributes']->setAttribute('class', 'my-class'); // } }
This works
function [hook]_form_alter(&$form, &$form_state, $form_id)
{
if(strpos($form_id, "poll_view_form") !== false){
\Drupal::service('honeypot')->addFormProtection($form, $form_state, array('honeypot', 'time_restriction'));
}
}
I dont think its a rude remark.
I migrated a set of sites from d7 to d8 and d9, and this issue is very confusing when you do not undertand how to map the old text formats to the new ones, or that you even needed to do so before you started....
The issue is not mentioned in the standard migration directives on the drupal sites.
If, like me, you v struggled to migrate a d7 site with thousands of nodes, first with drsuh, and than via the ui, and then with drush again, finding out that a former developer left a lot of D6 rubble in the database, or nodes without a contenttype, cause someone deleted that in like 1865, and then you finally see youv have succesfully migrated all content to D9, poured it into a docker or lando setup, connected a solr server, but than nothing shows, and you have this confusing text-format mess, and no indication of how to solve it, it is really irritating.
Do you have to study custom migrations, do you have to start over again?
I mean, a D7 D9 migration already take a huge amount of time for your clients, just rebuilding the theme for instance....
Solution
Me, in the above mentioned case, without a mapping, I just simply queried the new D9 database. First looked in the database export what tables had a _format (varchar 255) field.
Then generated a large SQL-query like...
(I added the php filter module because that one was extensively used in the D7 version)
update node__body set body_format = 'basic_html' where body_format = '1';update node_revision__body set body_format = 'basic_html' where body_format = '1';update node__body set body_format = 'full_html' where body_format = '2';update node_revision__body set body_format = 'full_html' where body_format = '2';update node__body set body_format = 'php_code' where body_format = '3';update node_revision__body set body_format = 'php_code' where body_format = '3';update node__body set body_format = 'plain_text' where body_format = '5';update node_revision__body set body_format = 'plain_text' where body_format = '5';