Commit dbb2c278 authored by andrei.dincu's avatar andrei.dincu
Browse files

Issue #2249723 by andrei.dincu: Make id varchar in xmlsitemap table to allow...

Issue #2249723 by andrei.dincu: Make id varchar in xmlsitemap table to allow saving entities that have string ids
parent a9020239
......@@ -165,10 +165,12 @@ function xmlsitemap_schema() {
'fields' => array(
'id' => array(
'description' => 'Primary key with type; a unique id for the item.',
'type' => 'int',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
'default' => '',
//'unsigned' => TRUE,
//'default' => 0,
),
'type' => array(
'description' => 'Primary key with id; the type of item (e.g. node, user, etc.).',
......
......@@ -1974,7 +1974,7 @@ function xmlsitemap_entity_create_link(EntityInterface $entity) {
$uri = $entity->url();
$entity->xmlsitemap += array(
'type' => $entity->getEntityTypeId(),
'id' => $entity->id(),
'id' => (string) $entity->id(),
'subtype' => $entity->bundle(),
'status' => $settings['status'],
'status_default' => $settings['status'],
......@@ -1988,7 +1988,6 @@ function xmlsitemap_entity_create_link(EntityInterface $entity) {
// The following values must always be checked because they are volatile.
$entity->xmlsitemap['loc'] = $uri;
$entity->xmlsitemap['access'] = isset($url) ? 1 : 0;
$entity->xmlsitemap['status'] = 1;
$language = $entity->language();
$entity->xmlsitemap['language'] = !empty($language) ? $language->getId() : LanguageInterface::LANGCODE_NOT_SPECIFIED;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment