Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
X
xmlsitemap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
xmlsitemap
Commits
3bf9694b
Commit
3bf9694b
authored
Apr 01, 2015
by
Michelle
Committed by
paulmckibben
Apr 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2427509
by paulmckibben, Michelle, andrei.dincu: Installation fails on Drupal 8 beta 6
parent
eb332878
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
53 additions
and
24 deletions
+53
-24
src/Entity/XmlSitemap.php
src/Entity/XmlSitemap.php
+2
-2
src/Form/XmlSitemapEntitiesSettingsForm.php
src/Form/XmlSitemapEntitiesSettingsForm.php
+7
-0
src/Form/XmlSitemapLinkBundleSettingsForm.php
src/Form/XmlSitemapLinkBundleSettingsForm.php
+7
-0
src/Form/XmlSitemapRebuildForm.php
src/Form/XmlSitemapRebuildForm.php
+7
-0
src/Form/XmlSitemapSettingsForm.php
src/Form/XmlSitemapSettingsForm.php
+7
-0
src/Tests/XmlSitemapTestBase.php
src/Tests/XmlSitemapTestBase.php
+1
-1
src/XmlSitemapGenerator.php
src/XmlSitemapGenerator.php
+2
-2
xmlsitemap.install
xmlsitemap.install
+2
-1
xmlsitemap.links.action.yml
xmlsitemap.links.action.yml
+1
-1
xmlsitemap.links.task.yml
xmlsitemap.links.task.yml
+3
-3
xmlsitemap.module
xmlsitemap.module
+11
-11
xmlsitemap.routing.yml
xmlsitemap.routing.yml
+3
-3
No files found.
src/Entity/XmlSitemap.php
View file @
3bf9694b
...
...
@@ -33,8 +33,8 @@ use Drupal\xmlsitemap\XmlSitemapInterface;
* "label" = "label"
* },
* links = {
* "edit-form" = "
xmlsitemap.admin_
edit",
* "delete-form" = "
xmlsitemap.admin_
delete"
* "edit-form" = "
/admin/config/search/xmlsitemap/{xmlsitemap}/
edit",
* "delete-form" = "
/admin/config/search/xmlsitemap/{xmlsitemap}/
delete"
* }
* )
*/
...
...
src/Form/XmlSitemapEntitiesSettingsForm.php
View file @
3bf9694b
...
...
@@ -58,6 +58,13 @@ class XmlSitemapEntitiesSettingsForm extends ConfigFormBase implements Container
);
}
/**
* {@inheritdoc}
*/
protected
function
getEditableConfigNames
()
{
return
[
'xmlsitemap.settings'
];
}
/**
* {@inheritdoc}
*/
...
...
src/Form/XmlSitemapLinkBundleSettingsForm.php
View file @
3bf9694b
...
...
@@ -61,6 +61,13 @@ class XmlSitemapLinkBundleSettingsForm extends ConfigFormBase implements Contain
);
}
/**
* {@inheritdoc}
*/
protected
function
getEditableConfigNames
()
{
return
[
'xmlsitemap.settings'
];
}
/**
* {@inheritdoc}
*/
...
...
src/Form/XmlSitemapRebuildForm.php
View file @
3bf9694b
...
...
@@ -55,6 +55,13 @@ class XmlSitemapRebuildForm extends ConfigFormBase {
return
'xmlsitemap_admin_rebuild'
;
}
/**
* {@inheritdoc}
*/
protected
function
getEditableConfigNames
()
{
return
[
'xmlsitemap.settings'
];
}
/**
* {@inheritdoc}
*/
...
...
src/Form/XmlSitemapSettingsForm.php
View file @
3bf9694b
...
...
@@ -78,6 +78,13 @@ class XmlSitemapSettingsForm extends ConfigFormBase {
return
'xmlsitemap_admin_settings'
;
}
/**
* {@inheritdoc}
*/
protected
function
getEditableConfigNames
()
{
return
[
'xmlsitemap.settings'
];
}
/**
* {@inheritdoc}
*/
...
...
src/Tests/XmlSitemapTestBase.php
View file @
3bf9694b
...
...
@@ -405,7 +405,7 @@ abstract class XmlSitemapTestBase extends WebTestBase {
if
(
$id
=
parent
::
verbose
(
$verbose_message
))
{
$url
=
file_create_url
(
$this
->
originalFileDirectory
.
'/simpletest/verbose/'
.
get_class
(
$this
)
.
'-'
.
$id
.
'.html'
);
$message_url
=
Url
::
fromUri
(
$url
,
array
(
'attributes'
=>
array
(
'target'
=>
'_blank'
)));
$this
->
error
(
$this
->
l
(
$message
,
$message_url
)
)
,
'User notice'
);
$this
->
error
(
$this
->
l
(
$message
,
$message_url
),
'User notice'
);
}
}
...
...
src/XmlSitemapGenerator.php
View file @
3bf9694b
...
...
@@ -80,7 +80,7 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
* The state handler.
*/
public
function
__construct
(
ConfigFactoryInterface
$config_factory
,
EntityManagerInterface
$entity_manager
,
StateInterface
$state
,
LanguageManagerInterface
$language_manager
)
{
$this
->
config
=
$config_factory
->
get
(
'xmlsitemap.settings'
);
$this
->
config
=
$config_factory
->
get
Editable
(
'xmlsitemap.settings'
);
$this
->
entityManager
=
$entity_manager
;
$this
->
state
=
$state
;
$this
->
languageManager
=
$language_manager
;
...
...
@@ -241,7 +241,7 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
);
// @todo Add a separate hook_xmlsitemap_link_url_alter() here?
$link
[
'loc'
]
=
empty
(
$link
[
'loc'
])
?
'<front>'
:
$link
[
'loc'
];
$link_url
=
Url
::
fromRoute
(
$link
[
'loc'
],
[],
$link_options
+
$url_options
);
$link_url
=
Url
::
fromRoute
(
$link
[
'loc'
],
[],
$link_options
+
$url_options
)
->
toString
()
;
// Skip this link if it was a duplicate of the last one.
// @todo Figure out a way to do this before generation so we can report
...
...
xmlsitemap.install
View file @
3bf9694b
...
...
@@ -315,8 +315,9 @@ function xmlsitemap_install() {
function
xmlsitemap_uninstall
()
{
// Remove config variables.
$variables
=
array_keys
(
xmlsitemap_config_variables
());
$editable
=
\
Drupal
::
configFactory
()
->
getEditable
(
'xmlsitemap.settings'
);
foreach
(
$variables
as
$variable
)
{
\
Drupal
::
config
(
'xmlsitemap.settings'
)
->
clear
(
$variable
);
$editable
->
clear
(
$variable
);
}
$variables
=
array_keys
(
xmlsitemap_state_variables
());
...
...
xmlsitemap.links.action.yml
View file @
3bf9694b
xmlsitemap.add
:
route_name
:
xmlsitemap.admin_add
route_name
:
entity.xmlsitemap.add_form
title
:
'
Add
XML
Sitemap'
appears_on
:
-
xmlsitemap.admin_search
...
...
xmlsitemap.links.task.yml
View file @
3bf9694b
xmlsitemap.add
:
route_name
:
'
xmlsitemap.admin_add
'
route_name
:
'
entity.xmlsitemap.add_form
'
title
:
'
Add
XmlSitemap'
appears_on
:
-
xmlsitemap.admin_search
-
xmlsitemap.admin_search_list
xmlsitemap.edit
:
route_name
:
'
xmlsitemap.admin_edit
'
route_name
:
'
entity.xmlsitemap.edit_form
'
title
:
'
Edit
XmlSitemap'
appears_on
:
-
xmlsitemap.admin_search
-
xmlsitemap.admin_search_list
xmlsitemap.delete
:
route_name
:
'
xmlsitemap.admin_delete
'
route_name
:
'
entity.xmlsitemap.delete_form
'
title
:
'
Delete
XmlSitemap'
appears_on
:
-
xmlsitemap.admin_search
...
...
xmlsitemap.module
View file @
3bf9694b
...
...
@@ -112,8 +112,8 @@ function xmlsitemap_help($route_name, RouteMatchInterface $route_match) {
case
'help.page.xmlsitemap'
:
case
'xmlsitemap.admin_settings'
:
case
'xmlsitemap.entities_settings'
:
case
'
xmlsitemap.admin_edit
'
:
case
'
xmlsitemap.admin_delete
'
:
case
'
entity.xmlsitemap.edit_form
'
:
case
'
entity.xmlsitemap.delete_form
'
:
return
;
case
'xmlsitemap.admin_search'
:
break
;
...
...
@@ -760,9 +760,9 @@ function xmlsitemap_link_bundle_settings_save($entity, $bundle, array $settings,
}
foreach
(
$settings
as
$key
=>
$value
)
{
\
Drupal
::
config
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle
}
"
)
->
set
(
$key
,
$value
);
\
Drupal
::
config
Factory
()
->
getEditable
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle
}
"
)
->
set
(
$key
,
$value
);
}
\
Drupal
::
config
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle
}
"
)
->
save
();
\
Drupal
::
config
Factory
()
->
getEditable
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle
}
"
)
->
save
();
foreach
(
\
Drupal
::
languageManager
()
->
getLanguages
()
as
$lang
)
{
\
Drupal
::
cache
()
->
delete
(
'xmlsitemap:link_info:'
.
$lang
->
getId
());
...
...
@@ -784,7 +784,7 @@ function xmlsitemap_link_bundle_rename($entity, $bundle_old, $bundle_new) {
if
(
$bundle_old
!=
$bundle_new
)
{
if
(
!
\
Drupal
::
config
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle_old
}
"
)
->
isNew
())
{
$settings
=
xmlsitemap_link_bundle_load
(
$entity
,
$bundle_old
);
\
Drupal
::
config
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle_old
}
"
)
->
delete
();
\
Drupal
::
config
Factory
()
->
getEditable
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle_old
}
"
)
->
delete
();
xmlsitemap_link_bundle_settings_save
(
$entity
,
$bundle_new
,
$settings
,
FALSE
);
\
Drupal
::
service
(
'xmlsitemap.link_storage'
)
->
updateMultiple
(
array
(
'subtype'
=>
$bundle_new
),
array
(
'type'
=>
$entity
,
'subtype'
=>
$bundle_old
));
}
...
...
@@ -807,10 +807,10 @@ function xmlsitemap_link_type_rename($entity_old, $entity_new, $bundles = NULL)
if
(
!
strpos
(
$key
,
"xmlsitemap_settings_
{
$entity_old
}
"
)
&&
!
strpos
(
$key
,
"xmlsitemap_entity_
{
$entity_old
}
"
))
{
continue
;
}
\
Drupal
::
config
(
'xmlsitemap.settings'
)
->
clear
(
$key
);
\
Drupal
::
config
Factory
()
->
getEditable
(
'xmlsitemap.settings'
)
->
clear
(
$key
);
if
(
isset
(
$value
))
{
$variable_new
=
str_replace
(
'xmlsitemap_settings_'
.
$entity_old
,
'xmlsitemap_settings_'
.
$entity_new
,
$key
);
\
Drupal
::
config
(
'xmlsitemap.settings'
)
->
set
(
$variable_new
,
$value
)
->
save
();
\
Drupal
::
config
Factory
()
->
getEditable
(
'xmlsitemap.settings'
)
->
set
(
$variable_new
,
$value
)
->
save
();
}
}
...
...
@@ -864,7 +864,7 @@ function xmlsitemap_link_bundle_load($entity, $bundle, $load_bundle_info = TRUE)
* If TRUE, deletes bundle links from {xmlsitemap} table.
*/
function
xmlsitemap_link_bundle_delete
(
$entity
,
$bundle
,
$delete_links
=
TRUE
)
{
\
Drupal
::
config
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle
}
"
)
->
delete
();
\
Drupal
::
config
Factory
()
->
getEditable
(
"xmlsitemap.settings.
{
$entity
}
.
{
$bundle
}
"
)
->
delete
();
if
(
$delete_links
)
{
\
Drupal
::
service
(
'xmlsitemap.link_storage'
)
->
deleteMultiple
(
array
(
'type'
=>
$entity
,
'subtype'
=>
$bundle
));
}
...
...
@@ -940,8 +940,8 @@ function xmlsitemap_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_n
/**
* Implements hook_entity_bundle_delete().
*/
function
xmlsitemap_entity_bundle_delete
(
$entity_type
,
$bundle
,
$instances
)
{
xmlsitemap_link_bundle_delete
(
$entity_type
,
$bundle
,
TRUE
);
function
xmlsitemap_entity_bundle_delete
(
$entity_type
_id
,
$bundle
)
{
xmlsitemap_link_bundle_delete
(
$entity_type
_id
,
$bundle
,
TRUE
);
}
/**
...
...
@@ -2391,7 +2391,7 @@ function xmlsitemap_check_status() {
$messages
=
array
();
foreach
(
$modules
as
$module
)
{
module_load_install
(
$module
);
$requirements
=
\
Drupal
::
moduleHandler
()
->
invoke
(
$module
,
'requirements'
,
'runtime'
);
$requirements
=
\
Drupal
::
moduleHandler
()
->
invoke
(
$module
,
'requirements'
,
array
(
'runtime'
)
);
foreach
(
$requirements
as
$requirement
)
{
if
(
isset
(
$requirement
[
'severity'
])
&&
max
(
REQUIREMENT_OK
,
$requirement
[
'severity'
]))
{
$messages
[]
=
$requirement
[
'description'
];
...
...
xmlsitemap.routing.yml
View file @
3bf9694b
...
...
@@ -14,7 +14,7 @@ xmlsitemap.admin_search_list:
requirements
:
_permission
:
'
administer
xmlsitemap'
xmlsitemap.admin_add
:
entity.xmlsitemap.add_form
:
path
:
'
/admin/config/search/xmlsitemap/add'
defaults
:
_entity_form
:
'
xmlsitemap.add'
...
...
@@ -22,7 +22,7 @@ xmlsitemap.admin_add:
requirements
:
_permission
:
'
administer
xmlsitemap'
xmlsitemap.admin_edit
:
entity.xmlsitemap.edit_form
:
path
:
'
/admin/config/search/xmlsitemap/{xmlsitemap}/edit'
defaults
:
_entity_form
:
'
xmlsitemap.edit'
...
...
@@ -30,7 +30,7 @@ xmlsitemap.admin_edit:
requirements
:
_permission
:
'
administer
xmlsitemap'
xmlsitemap.admin_delete
:
entity.xmlsitemap.delete_form
:
path
:
'
/admin/config/search/xmlsitemap/{xmlsitemap}/delete'
defaults
:
_entity_form
:
'
xmlsitemap.delete'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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