Changelog zur Manifest-Datei hinzufügen

From Joomla! Documentation

Revision as of 14:32, 25 June 2019 by Max123kl (talk | contribs) (Created page with "== Ein Changelog-URL-Tag in Manifest-Dateien einfügen ==")
Joomla! 
4.x
>Tutorial

Seit Joomla 4.0 können Extension-Entwickler die Fähigkeit von Joomla nutzen, eine Changelog-Datei zu lesen und eine visuelle Darstellung des Changelogs zu geben. Wenn eine bestimmte Version nicht im Changelog gefunden wird, wird die Schaltfläche Changelog nicht angezeigt.

Die Änderungen in einer Version werden so dargestellt:

Changelog modal

Das Changelog wird an zwei verschiedenen Stellen verwendet.

Update Ansicht

Das Installationsprogramm zeigt das Changelog der Version an, die installiert werden kann, falls verfügbar.

Changelog button on the Update View

Durch klicken auf die AAAA-Schaltfläche wird das Änderungsprotokoll der neu verfügbaren Version angezeigt.

Manager-Ansicht

Der Erweiterungs-Manager zeigt das Änderungsprotokoll der aktuell installierten Erweiterung an, falls verfügbar.

Version number is a link to the changelog modal

Durch klicken auf die Versionsnummer wird das Änderungsprotokoll der aktuell installierten Version angezeigt.

Ein Changelog-URL-Tag in Manifest-Dateien einfügen

The first step is to update your manifest files that tell Joomla where to find the changelog details. Add the following node to your manifest XML files:

<changelogurl>https://example.com/updates/changelog.xml</changelogurl>

Update server manifest

See this example for an update server manifest file that informs Joomla about an update of a component named "com_lists". Thus you will see the Changelog button in the update view.

<?xml version="1.0" encoding="utf-8"?>
<updates>
 <update>
  <name>Student List</name>
  <description>List of students</description>
  <element>com_lists</element>
  <type>component</type>
  <version>4.0.0</version>

  <changelogurl>https://example.com/updates/changelog.xml</changelogurl>

  <tags>
   <tag>stable</tag>
  </tags>
  <maintainer>Example Miller</maintainer>
  <maintainerurl>https://example.com/</maintainerurl>
  <section>Updates</section>
  <targetplatform name="joomla" version="4.?" />
  <client>1</client>
  <folder></folder>
 </update>
</updates>

Extension manifest

Additionally add the changelogurl tag to the extension manifest XML. Thus the extension version will be linked to the changelogs in the manage view.

<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2.0" method="upgrade">
	<name>COM_LISTS</name>

... Other stuff ...

	<changelogurl>https://example.com/updates/changelog.xml</changelogurl>

	<updateservers>
        <server type="extension" name="My Extension's Updates">https://example.com/lists-updates.xml</server>
	</updateservers>
</extension>

Create changelog file

The changelog file must have the following 3 nodes:

  • element
  • type
  • version

This information is used to identify the correct changelog for a given extension.

A version node inside any changelog node is always mandatory. Otherwise you will see an error message like SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data.

<element>com_lists</element>
<type>component</type>
<version>4.0.0</version>

Further the changelog is filled with one or more change types. The following change types are supported:

  • security: Any security issues that have been fixed
  • fix: Any bugs that have been fixed
  • language: This is for language changes
  • addition: Any new features added
  • change: Any changes
  • remove: Any features removed
  • note: Any extra information to inform the user

Each node can be repeated as many times as needed.

The format of the text can be plain text or HTML but in case of HTML, it must be enclosed in CDATA tags as shown in the example.

<changelogs>
    <changelog>
        <element>com_lists</element>
        <type>component</type>
        <version>4.0.0</version>
        <security>
            <item>Item A</item>
            <item><![CDATA[<h2>You MUST replace this file</h2>]]></item>
        </security>
        <fix>
            <item>Item A</item>
            <item>Item b</item>
        </fix>
        <language>
            <item>Item A</item>
            <item>Item b</item>
        </language>
        <addition>
            <item>Item A</item>
            <item>Item b</item>
        </addition>
        <change>
            <item>Item A</item>
            <item>Item b</item>
        </change>
        <remove>
            <item>Item A</item>
            <item>Item b</item>
        </remove>
        <note>
            <item>Item A</item>
            <item>Item b</item>
        </note>
</changelog>
<changelog>
	<element>com_lists</element>
	<type>component</type>
	<version>0.0.2</version>
	<security>
		<item>Big issue</item>
	</security>
</changelog>
</changelogs>

This file contains 2 changelogs:

  • Version 0.0.2 (for testing the manage view)
  • Version 4.0.0 (for testing the update view)

A changelog can have as many versions as needed.