Foren

patches and fixes

gordon daniels, geändert vor 12 Jahren.

patches and fixes

Liferay Master Beiträge: 797 Beitrittsdatum: 24.08.08 Neueste Beiträge
This is such a newbie sounding question :-) Htow do I get the patches and fixes that are posted on jira. I've searched the liferay site but I must be using the wrong terms. Is there a doc that tells how to get them and apply them?

thanks
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: patches and fixes

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
You'll need to get the EE subscription to get patches from liferay.
gordon daniels, geändert vor 12 Jahren.

RE: patches and fixes

Liferay Master Beiträge: 797 Beitrittsdatum: 24.08.08 Neueste Beiträge
thanks.
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: patches and fixes

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
If there's a *.patch file attached to the jira issue, you'll be able to apply it.

Check Mauro Mariuzzo's September 22, 2008 6:57 AM post
http://www.liferay.com/web/guest/community/forums/-/message_boards/message/960939

And following thread on general instructions.
http://www.liferay.com/community/forums/-/message_boards/message/6921956

You'll need to rebuild Liferay from source. You'll be able to get Liferay source from the download site: (liferay-portal-src-6.1.0-ce-ga1-20120106155615760.zip)

http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.1.0%20GA1/


.
gordon daniels, geändert vor 11 Jahren.

RE: patches and fixes

Liferay Master Beiträge: 797 Beitrittsdatum: 24.08.08 Neueste Beiträge
thanks for the help.
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: patches and fixes

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
I think the patches in jira are actual patch files (patch files are a unix thing but they can be used in windows w/ the right toolset).

Unfortunately you need to know a little about patch in order to know which directory you need to be in when you process the patch file (the patch file lists the chunks of the file(s) that will be updated, and from that you determine if you're installing from the root of the source tree or whether you need to navigate into the tree first).

The problem you're going to have is dealing with collisions (a patch is created for an original file but you want to apply it to a file that was already patched previously, or the patch is created from a patched file but you haven't applied that patch so the current patch might not apply correctly).

If you research a little on patch files, you will soon realize that the contents are actually pretty easy to understand and apply manually. They typically list the file(s) and line(s) where the replacement code is going, what is being replaced, and often times some surrounding lines that are unchanged. To that end you could selectively start manually applying the patches, but you'll still have the collisions issue plus the added issue of possible user error (only applying part of a patch file).

Probably the cleanest way to handle this would be through an EXT plugin. Copy the files from the source tree to the appropriate places in the EXT plugin and apply the patches there, then deploy the EXT plugin.
gordon daniels, geändert vor 12 Jahren.

RE: patches and fixes

Liferay Master Beiträge: 797 Beitrittsdatum: 24.08.08 Neueste Beiträge
David: thanks for such a substanitive explanation.
thumbnail
Enrique Valdes Lacasa, geändert vor 9 Jahren.

RE: patches and fixes

Junior Member Beiträge: 92 Beitrittsdatum: 29.07.14 Neueste Beiträge
Hello everyone. Hitachi, In my opinion patching is not only restricted to Liferay EE. Liferay CE can get patched as well if users find the appropriate fix in the Liferay Portal Community Edition section of the Liferay Jira website.

Since I am in the process of applying a fix for Liferay 6.2 CE, I can provide some feedback about it as well as maybe improve my direction with some feedback, since I didn't apply it yet. What I would recommend for Liferay CE users when solving Liferay bugs would be the following:

1) First of all, if a very abnormal behavior is found in the Portal (something that really looks like a bug) a user might be able to find the fixed issue with its corresponding ticket in the Jira site mentioned above. Google usually just brings them up as LPS-XXXX.. when we look for help. Bugs are not found everyday in Liferay... but sometimes we clearly bump into them.

2) In the LPS-XXXx.. page of the issue in Jira, if we see the history of an issue, we can get the links to the specific Github commits related to the issue. In my case, this was the issue I found: https://issues.liferay.com/browse/LPS-48441. So I found the link for the specific commits I am interested in.

3) Once we visit a commit related to the issue, let's say in this example: https://github.com/marcellustavares/liferay-portal/commit/c7cb25fb634a33936389b118382326a47018e318. If we attach a .patch at the end of the URL, we will be able to get the commit as a .patch file to download, and later on apply it. Like this: https://github.com/marcellustavares/liferay-portal/commit/c7cb25fb634a33936389b118382326a47018e318.patch

I guess that specially in Liferay CE it is important of being capable of applying patches, since releases between different versions can get some time to happen. In my case, I found a solved Liferay issue affecting Liferay CE 6.2 and I have to apply the fix by myself, since I am using the latest version. Before finding this thread, I was thinking about implementing the approach that David mentioned, using an Ext plugin. So I guess that implementing an Ext plugin with the fix will be my solution...but I am worried about the possible collisions that could happen with later releases of the Liferay 6.2 CE if we would have to update.

So here is my question. Would you recommend me implementing the fix in an Ext plugin? or simply rebuilding the bundle with the fix in it? It seems to me that the Ext plugin would be more portable to move between different environments, and that is the reason why I think I am going to choose it.

Thanks for any suggestions. I hope that my directions can also help someone when tracking Liferay bugs.

PS: It would be nice if the .patch file could somehow be applied more easily than copying and pasting around.
thumbnail
David H Nebinger, geändert vor 9 Jahren.

RE: patches and fixes

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
Enrique Valdes Lacasa:
So here is my question. Would you recommend me implementing the fix in an Ext plugin? or simply rebuilding the bundle with the fix in it? It seems to me that the Ext plugin would be more portable to move between different environments, and that is the reason why I think I am going to choose it.


So an EXT seems like an obvious choice for the reason you mention, but the problem is that patches are cumulative, each subsequent patch may rely upon a fix from a previously applied patch. You also asked whether they can be applied systematically, well that's what .patch files are, they are a defined format which unix system admins would be familar with and would know how to apply.

So the common use case is to apply patches to the source, build, and then push the created artifacts out to the servers. Regardless which way you go, it's still a lot of work to keep up to date on patches.

Which is why I think most people tend to wait for the next GA to come out w/ all of the patches applied. Less work as an admin, but leaves you vulnerable or bugged until the GA comes out and lately it just seems like there is a long time between the GAs.

For awhile we had lcepatchers.org site where the patches were being applied and you could download updated artifacts, but the primary on the site was hired by Liferay and there was no one left to pick up where he left off.
thumbnail
Enrique Valdes Lacasa, geändert vor 9 Jahren.

RE: patches and fixes

Junior Member Beiträge: 92 Beitrittsdatum: 29.07.14 Neueste Beiträge
Thanks David! I am going to follow that path. Regards.