Make sitemap priority no longer configurable
authorMarcel Werk <burntime@woltlab.com>
Fri, 5 May 2023 10:16:21 +0000 (12:16 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 5 May 2023 10:16:21 +0000 (12:16 +0200)
Closes #5309

wcfsetup/install/files/acp/templates/sitemapEdit.tpl
wcfsetup/install/files/lib/acp/form/SitemapEditForm.class.php
wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 9b19fa090160f5a811f8de19e41fca832e0208cd..8b1e33d85d3a206ed76bedc9cdcea75fffaacd5c 100755 (executable)
 
 <form method="post" action="{link controller='SitemapEdit'}objectType={$objectType->objectType}{/link}">
        <div class="section">
-               <dl{if $errorField == 'priority'} class="formError"{/if}>
-                       <dt><label for="priority">{lang}wcf.acp.sitemap.priority{/lang}</label></dt>
-                       <dd>
-                               <input type="number" id="priority" name="priority" step="0.1" min="0" max="1" value="{$priority}" class="short"/>
-                               {if $errorField == 'priority'}
-                                       <small class="innerError">
-                                               {lang}wcf.acp.sitemap.priority.error.{$errorType}{/lang}
-                                       </small>
-                               {/if}
-                               <small>{lang}wcf.acp.sitemap.priority.description{/lang}</small>
-                       </dd>
-               </dl>
-               
                <dl{if $errorField == 'changeFreq'} class="formError"{/if}>
                        <dt><label for="changeFreq">{lang}wcf.acp.sitemap.changeFreq{/lang}</label></dt>
                        <dd>
index 69a53586044ccebfaf8e388854b893411f4c9929..bb03af7e71d6ded1e7ceb5980fdb8feb94c0869b 100755 (executable)
@@ -48,12 +48,6 @@ class SitemapEditForm extends AbstractForm
      */
     public $objectType;
 
-    /**
-     * The priority for this sitemap object.
-     * @var float
-     */
-    public $priority = 0.5;
-
     /**
      * The changeFreq for this sitemap object.
      * @var string
@@ -122,14 +116,10 @@ class SitemapEditForm extends AbstractForm
             $sitemapData = @\unserialize($sitemapData);
 
             if (\is_array($sitemapData)) {
-                $this->priority = $sitemapData['priority'];
                 $this->changeFreq = $sitemapData['changeFreq'];
                 $this->rebuildTime = $sitemapData['rebuildTime'];
                 $this->isDisabled = $sitemapData['isDisabled'];
             } else {
-                if ($this->objectType->priority !== null) {
-                    $this->priority = $this->objectType->priority;
-                }
                 if ($this->objectType->changeFreq !== null) {
                     $this->changeFreq = $this->objectType->changeFreq;
                 }
@@ -150,9 +140,6 @@ class SitemapEditForm extends AbstractForm
     {
         parent::readFormParameters();
 
-        if (isset($_POST['priority'])) {
-            $this->priority = \round(\floatval($_POST['priority']), 1);
-        }
         if (isset($_POST['changeFreq'])) {
             $this->changeFreq = $_POST['changeFreq'];
         }
@@ -169,10 +156,6 @@ class SitemapEditForm extends AbstractForm
     {
         parent::validate();
 
-        if ($this->priority > 1 || $this->priority < 0) {
-            throw new UserInputException('priority', 'invalid');
-        }
-
         if (!\in_array($this->changeFreq, $this->validChangeFreq)) {
             throw new UserInputException('changeFreq');
         }
@@ -189,7 +172,6 @@ class SitemapEditForm extends AbstractForm
             'com.woltlab.wcf',
             SitemapRebuildWorker::REGISTRY_PREFIX . $this->objectTypeName,
             \serialize([
-                'priority' => $this->priority,
                 'changeFreq' => $this->changeFreq,
                 'rebuildTime' => $this->rebuildTime,
                 'isDisabled' => $this->isDisabled,
@@ -211,7 +193,6 @@ class SitemapEditForm extends AbstractForm
 
         WCF::getTPL()->assign([
             'objectType' => $this->objectType,
-            'priority' => $this->priority,
             'changeFreq' => $this->changeFreq,
             'rebuildTime' => $this->rebuildTime,
             'validChangeFreq' => $this->validChangeFreq,
index 8d53963cdcb763ed240d735da730a4ff829475c7..d7cf537a14d66e44b4ee87253acceb3d276d4335 100755 (executable)
@@ -524,7 +524,6 @@ class SitemapRebuildWorker extends AbstractRebuildDataWorker
             $sitemapData = @\unserialize($sitemapData);
 
             if (\is_array($sitemapData)) {
-                $object->priority = $sitemapData['priority'];
                 $object->changeFreq = $sitemapData['changeFreq'];
                 $object->rebuildTime = $sitemapData['rebuildTime'];
                 $object->isDisabled = $sitemapData['isDisabled'];
index 69ee54f1cbb6419c69d1db8676df474d9b538889..262ad59f42778e6b7821a9a544e46bd3f5a5b53e 100644 (file)
@@ -2717,8 +2717,6 @@ Abschnitte dürfen nicht leer sein und nur folgende Zeichen enthalten: <kbd>[a-z
        <category name="wcf.acp.sitemap">
                <item name="wcf.acp.sitemap"><![CDATA[Sitemap]]></item>
                <item name="wcf.acp.sitemap.priority"><![CDATA[Priorität]]></item>
-               <item name="wcf.acp.sitemap.priority.description"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Gebe{else}Geben Sie{/if} hier die Priorität der Einträge in dieser Sitemap an. Gültige Werte liegen zwischen 0,0 und 1,0.]]></item>
-               <item name="wcf.acp.sitemap.priority.error.invalid"><![CDATA[Der Wert muss zwischen 0,0 und 1,0 liegen.]]></item>
                <item name="wcf.acp.sitemap.changeFreq"><![CDATA[Änderungsfrequenz]]></item>
                <item name="wcf.acp.sitemap.changeFreq.always"><![CDATA[Immer]]></item>
                <item name="wcf.acp.sitemap.changeFreq.hourly"><![CDATA[Stündlich]]></item>
index 0560434073d2f5e3cd501a23cd9feb7a6cddfce7..467f5401efcb853b0995f0a4577835090de9c601 100644 (file)
@@ -2647,8 +2647,6 @@ If you have <strong>already bought the licenses for the listed apps</strong>, th
        <category name="wcf.acp.sitemap">
                <item name="wcf.acp.sitemap"><![CDATA[Sitemap]]></item>
                <item name="wcf.acp.sitemap.priority"><![CDATA[Priority]]></item>
-               <item name="wcf.acp.sitemap.priority.description"><![CDATA[The priority of the sitemap items. The value must be between 0.0 and 1.0.]]></item>
-               <item name="wcf.acp.sitemap.priority.error.invalid"><![CDATA[The value must be between 0.0 and 1.0.]]></item>
                <item name="wcf.acp.sitemap.changeFreq"><![CDATA[Change Frequency]]></item>
                <item name="wcf.acp.sitemap.changeFreq.always"><![CDATA[Always]]></item>
                <item name="wcf.acp.sitemap.changeFreq.hourly"><![CDATA[Hourly]]></item>