Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WCMS
uw_ct_contact
Commits
e5c66a58
Commit
e5c66a58
authored
Feb 01, 2022
by
Chris Shantz
Browse files
Merge branch '1.0.x' into prod/1.0.x
parents
13681958
3bdb756f
Changes
9
Hide whitespace changes
Inline
Side-by-side
config/install/core.entity_form_display.node.uw_ct_contact.default.yml
View file @
e5c66a58
...
...
@@ -2,6 +2,7 @@ langcode: en
status
:
true
dependencies
:
config
:
-
field.field.node.uw_ct_contact.field_uw_contact_listing_image
-
field.field.node.uw_ct_contact.field_uw_ct_contact_affiliation
-
field.field.node.uw_ct_contact.field_uw_ct_contact_contact_for
-
field.field.node.uw_ct_contact.field_uw_ct_contact_email
...
...
@@ -25,7 +26,6 @@ dependencies:
module
:
-
autocomplete_deluxe
-
conditional_fields
-
content_moderation
-
field_group
-
link
-
media_library
...
...
@@ -40,7 +40,7 @@ third_party_settings:
-
field_uw_ct_contact_method
-
field_uw_ct_contact_fields
parent_name
:
'
'
weight
:
1
weight
:
3
format_type
:
details
region
:
content
format_settings
:
...
...
@@ -76,6 +76,13 @@ content:
region
:
content
settings
:
{
}
third_party_settings
:
{
}
field_uw_contact_listing_image
:
type
:
media_library_widget
weight
:
4
settings
:
media_types
:
{
}
third_party_settings
:
{
}
region
:
content
field_uw_ct_contact_affiliation
:
weight
:
7
settings
:
...
...
@@ -143,7 +150,7 @@ content:
region
:
content
field_uw_ct_contact_image
:
type
:
media_library_widget
weight
:
3
weight
:
5
settings
:
media_types
:
{
}
third_party_settings
:
{
}
...
...
@@ -194,7 +201,7 @@ content:
type
:
telephone_default
region
:
content
field_uw_ct_contact_sort_name
:
weight
:
5
weight
:
2
settings
:
size
:
60
placeholder
:
'
'
...
...
@@ -289,7 +296,7 @@ content:
third_party_settings
:
{
}
title
:
type
:
string_textfield
weight
:
4
weight
:
1
region
:
content
settings
:
size
:
60
...
...
config/install/core.entity_view_display.node.uw_ct_contact.default.yml
View file @
e5c66a58
...
...
@@ -2,6 +2,7 @@ langcode: en
status
:
true
dependencies
:
config
:
-
field.field.node.uw_ct_contact.field_uw_contact_listing_image
-
field.field.node.uw_ct_contact.field_uw_ct_contact_affiliation
-
field.field.node.uw_ct_contact.field_uw_ct_contact_contact_for
-
field.field.node.uw_ct_contact.field_uw_ct_contact_email
...
...
@@ -69,6 +70,15 @@ content:
settings
:
{
}
third_party_settings
:
{
}
region
:
content
field_uw_contact_listing_image
:
type
:
entity_reference_entity_view
weight
:
119
label
:
above
settings
:
view_mode
:
default
link
:
false
third_party_settings
:
{
}
region
:
first
field_uw_ct_contact_affiliation
:
weight
:
107
label
:
above
...
...
config/install/core.entity_view_display.node.uw_ct_contact.teaser.yml
View file @
e5c66a58
...
...
@@ -3,6 +3,7 @@ status: true
dependencies
:
config
:
-
core.entity_view_mode.node.teaser
-
field.field.node.uw_ct_contact.field_uw_contact_listing_image
-
field.field.node.uw_ct_contact.field_uw_ct_contact_affiliation
-
field.field.node.uw_ct_contact.field_uw_ct_contact_contact_for
-
field.field.node.uw_ct_contact.field_uw_ct_contact_email
...
...
@@ -139,6 +140,7 @@ content:
third_party_settings
:
{
}
hidden
:
content_moderation_control
:
true
field_uw_contact_listing_image
:
true
field_uw_ct_contact_affiliation
:
true
field_uw_ct_contact_fields
:
true
field_uw_ct_contact_method
:
true
...
...
config/install/field.field.node.uw_ct_contact.field_uw_contact_listing_image.yml
0 → 100644
View file @
e5c66a58
langcode
:
en
status
:
true
dependencies
:
config
:
-
field.storage.node.field_uw_contact_listing_image
-
media.type.uw_mt_image
-
node.type.uw_ct_contact
id
:
node.uw_ct_contact.field_uw_contact_listing_image
field_name
:
field_uw_contact_listing_image
entity_type
:
node
bundle
:
uw_ct_contact
label
:
'
Listing
image'
description
:
'
'
required
:
false
translatable
:
false
default_value
:
{
}
default_value_callback
:
'
'
settings
:
handler
:
'
default:media'
handler_settings
:
target_bundles
:
uw_mt_image
:
uw_mt_image
sort
:
field
:
_none
direction
:
ASC
auto_create
:
false
auto_create_bundle
:
'
'
field_type
:
entity_reference
config/install/field.field.node.uw_ct_contact.field_uw_ct_contact_image.yml
View file @
e5c66a58
langcode
:
en
status
:
true
dependencies
:
...
...
@@ -10,7 +11,6 @@ field_name: field_uw_ct_contact_image
entity_type
:
node
bundle
:
uw_ct_contact
label
:
'
Image
(portrait)'
description
:
'
This
image
will
be
used
on
the
content
as
well
as
the
listing
page.'
required
:
false
translatable
:
false
default_value
:
{
}
...
...
config/install/field.storage.node.field_uw_contact_listing_image.yml
0 → 100644
View file @
e5c66a58
langcode
:
en
status
:
true
dependencies
:
module
:
-
media
-
node
id
:
node.field_uw_contact_listing_image
field_name
:
field_uw_contact_listing_image
entity_type
:
node
type
:
entity_reference
settings
:
target_type
:
media
module
:
core
locked
:
false
cardinality
:
1
translatable
:
true
indexes
:
{
}
persist_with_no_fields
:
false
custom_storage
:
false
config/install/node.type.uw_ct_contact.yml
View file @
e5c66a58
...
...
@@ -18,6 +18,7 @@ third_party_settings:
token
:
0
menu_ui
:
available_menus
:
-
uw-menu-audience-menu
-
main
parent
:
'
main:'
node_revision_delete
:
...
...
config/install/views.view.uw_view_contacts.yml
View file @
e5c66a58
...
...
@@ -316,6 +316,7 @@ display:
exposed
:
false
expose
:
label
:
'
'
field_identifier
:
sticky
entity_type
:
node
entity_field
:
sticky
plugin_id
:
standard
...
...
@@ -330,6 +331,7 @@ display:
exposed
:
false
expose
:
label
:
'
'
field_identifier
:
weight
draggable_views_reference
:
this
draggable_views_null_order
:
after
plugin_id
:
draggable_views_sort_default
...
...
@@ -344,6 +346,7 @@ display:
exposed
:
false
expose
:
label
:
'
'
field_identifier
:
field_uw_ct_contact_sort_name_value
plugin_id
:
standard
title
:
Contacts
header
:
{
}
...
...
@@ -552,6 +555,7 @@ display:
exposed
:
false
expose
:
label
:
'
'
field_identifier
:
sticky
entity_type
:
node
entity_field
:
sticky
plugin_id
:
standard
...
...
@@ -566,6 +570,7 @@ display:
exposed
:
false
expose
:
label
:
'
'
field_identifier
:
weight
draggable_views_reference
:
'
uw_view_contacts:rearrange_contacts'
draggable_views_null_order
:
after
plugin_id
:
draggable_views_sort_default
...
...
@@ -580,6 +585,7 @@ display:
exposed
:
false
expose
:
label
:
'
'
field_identifier
:
field_uw_ct_contact_sort_name_value
plugin_id
:
standard
empty
:
area
:
...
...
uw_ct_contact.install
View file @
e5c66a58
...
...
@@ -141,3 +141,30 @@ function uw_ct_contact_update_8101(&$sandbox) {
}
}
}
/**
* Sets the listing image to the portrait image.
*/
function
uw_ct_contact_update_9101
(
&
$sandbox
)
{
// The config updater, so that we can import the new field.
$configUpdate
=
\
Drupal
::
service
(
'features.config_update'
);
// Import the new listing image field storage and config.
$configUpdate
->
import
(
'field_storage_config'
,
'node.field_uw_contact_listing_image'
);
$configUpdate
->
import
(
'field_config'
,
'node.uw_ct_contact.field_uw_contact_listing_image'
);
// Get all the nids of contact.
$nids
=
\
Drupal
::
entityQuery
(
'node'
)
->
condition
(
'type'
,
'uw_ct_contact'
)
->
execute
();
// Get all the contact nodes.
$nodes
=
\
Drupal\node\Entity\Node
::
loadMultiple
(
$nids
);
// Step through each of the contact node and set the listing image
// to the portrait image. We can just blindly do this, as if there
// is no portrait there will be no listing.
foreach
(
$nodes
as
$node
)
{
$node
->
set
(
'field_uw_contact_listing_image'
,
$node
->
field_uw_ct_contact_image
->
getValue
());
$node
->
save
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment