Difference between revisions of "Creating a patch/fr"

From Joomla! Documentation

< Creating a patch
(Created page with "Assurez-vous d'être dans répertoire racine de Joomla et non pas dans le répertoire des fichiers (vous devez voir des dossiers tels que : libraries, administrator, plugins,...")
(Created page with "Si vous utilisez Subclipse pour Eclipse, vous pouvez vérifier un nouveau projet à partir du SVN de Joomla! (quelle que soit la branche/version concernée par votre anomalie)...")
Line 11: Line 11:
  
 
= Création d'un patch avec Eclipse =
 
= Création d'un patch avec Eclipse =
If you've got Subclipse and Eclipse you can check out a new project from the Joomla! SVN (which ever branch/release is relevant to your bug) and then use this to create a patch file. Keep in mind that by default Eclipse creates patches that includes the entire path to the files, which isn't what we want. Presuming you created a new project using the checkout from SVN and used the root of a Joomla! instance, you should be able to create a valid patch easily.
+
Si vous utilisez Subclipse pour Eclipse, vous pouvez vérifier un nouveau projet à partir du SVN de Joomla! (quelle que soit la branche/version concernée par votre anomalie) et ainsi l'utiliser pour créer un fichier correctif. Gardez à l'esprit que, par défaut, Eclipse créé des correctifs qui reprennent l'intégralité du chemin d'accès aux fichiers ce qui n'est absolument pas ce que nous recherchons. En supposant que vous avez créé un nouveau projet à l'aide du checkout du SVN et utilisé la racine de Joomla, vous devriez être en mesure de créer facilement un correctif valide.
  
 
To create a patch, select the files you have changed and then right click on one of them and select "Team > Create Patch". The first screen asks you where you want to put the file: the clipboard, into the filesystem or in the workspace. Typically you'll want to create it somewhere in the filesystem. I personally use a patch folder where I keep all of the patches that I make. You should also notice at the bottom of this screen the list of files that will be included in this patch. If you have included files you didn't want to, you can deselect them here. If you are missing a file from this list you will need to reselect your files and add them.
 
To create a patch, select the files you have changed and then right click on one of them and select "Team > Create Patch". The first screen asks you where you want to put the file: the clipboard, into the filesystem or in the workspace. Typically you'll want to create it somewhere in the filesystem. I personally use a patch folder where I keep all of the patches that I make. You should also notice at the bottom of this screen the list of files that will be included in this patch. If you have included files you didn't want to, you can deselect them here. If you are missing a file from this list you will need to reselect your files and add them.

Revision as of 10:51, 4 May 2015

Une part importante dans la création d'un patch pour Joomla! est de vous assurer que vous l'avez créé correctement. La norme impose que tous les patchs soient créés à la racine de votre site Joomla. De cette façon, lorsque nous sommes amenés à le tester, nous n'avons pas besoin de travailler en dehors du répertoire dans lequel se trouve le fichier que vous tentez de changer ou, de devoir modifier votre fichier correctif pour le faire fonctionner correctement sur notre propre système local. Ceci peut être un problème car si votre correctif ne modifie qu'un unique fichier, il se peut qu'il existe déjà un même fichier avec ce nom. Par exemple, nous avons récemment reçu un correctif pour un fichier appelé banner.php. Il existe déjà cinq différents fichiers de Joomla! appelé banner.php. Il convient alors de déterminer et travailler sur le fichier concerné.

Création d'un patch correctif avec la ligne de commande[edit]

Pour les utilisateurs Linux/Mac, l'utilisation des lignes de commande reste souvent le moyen le plus rapide pour la création d'un correctif. En fonction des modifications que vous avez déjà apportées à votre installation en locale, vous pourriez avoir quelques nouveaux changements à opérer. Le meilleur moyen pour éviter cela est de partir d'une nouvelle installation de Joomla! à partir du SVN et d'y d'apporter vos modifications. Puis, à la racine de votre Joomla, vous pouvez exécuter la commande suivante :

svn diff > file.patch

Vous devez vous assurer que seules les modifications que vous avez effectuées sont présentes dans le fichier et aucun autre changement non souhaité. Si vous ne pouvez pas, vous devrez spécifier les fichiers que vous avez modifiés pour faire partie du patch correctif :

svn diff libraries/joomla/database/table.php > jtable.patch

Assurez-vous d'être dans répertoire racine de Joomla et non pas dans le répertoire des fichiers (vous devez voir des dossiers tels que : libraries, administrator, plugins, components, modules, etc).

Création d'un patch avec Eclipse[edit]

Si vous utilisez Subclipse pour Eclipse, vous pouvez vérifier un nouveau projet à partir du SVN de Joomla! (quelle que soit la branche/version concernée par votre anomalie) et ainsi l'utiliser pour créer un fichier correctif. Gardez à l'esprit que, par défaut, Eclipse créé des correctifs qui reprennent l'intégralité du chemin d'accès aux fichiers ce qui n'est absolument pas ce que nous recherchons. En supposant que vous avez créé un nouveau projet à l'aide du checkout du SVN et utilisé la racine de Joomla, vous devriez être en mesure de créer facilement un correctif valide.

To create a patch, select the files you have changed and then right click on one of them and select "Team > Create Patch". The first screen asks you where you want to put the file: the clipboard, into the filesystem or in the workspace. Typically you'll want to create it somewhere in the filesystem. I personally use a patch folder where I keep all of the patches that I make. You should also notice at the bottom of this screen the list of files that will be included in this patch. If you have included files you didn't want to, you can deselect them here. If you are missing a file from this list you will need to reselect your files and add them.

Once you have worked out where you are going to put the patch and that you've selected the right files, click "Next" to continue. If you click "Finish" here your patch will be created incorrect so it is important that you click "Next" here. In this area select "Project" and then click "Finish" to create the patch. Doing this will ensure that your patch file is created properly.

Creating a patch using NetBeans[edit]

You can use NetBeans IDE to create patch files too. There's a video that explains how to create a patch for Joomla! with SVN: http://www.vimeo.com/11981229.

Fins de lignes et encodages[edit]

It is important that with anything you add that you are using the correct line endings. The line ending style for Joomla! is just line feeds or Unix style, and all files should use the UTF-8 encoding. If you are using Eclipse you can change your settings in Window -> Preferences -> General -> Workspace. Select your text file encoding as UTF-8 and your line delimiter as "Unix".