[patch] bulk update of custom fields
sergii
Joined: 2006-10-29
Posts: 16 |
Posted: Sat, 2006-11-04 12:35 | |||
attached is a patch for customfield module that allows one to set custom fields in all items in a given album and its sub-albums. A new form appears on a [Custom Fields] tab of "Edit Album"
|
||||
Posts: 560
Hey, thanks for the patch! It's tested on current svn version, right?
Posts: 16
No, it isn't. From the list of API changes and change history for customfield module it doesn't look like there should be any problems applying the patch to the current version. But I didn't try.
Posts: 17
i'm new in all this kind of things. i've been using gallery for 2 months or so. how am i supposed to apply this kind of patches??? thnx
Posts: 17
ok, it works for me! now I am trying to use a similar code to creat a "really advanced search" where anyone could search in every custom field. Any idea on how to do it?? I'm also posting these ideas here:
http://gallery.menalto.com/node/40453
Please, someone help me! thnx
Posts: 3
Any chance someone can post a link to the files already altered. I only have FTP access to the machine that the files are on and I don't know how to apply the patch files on a Windows machine. Thanks
Posts: 5
Can someone please explain to me how i apply this patch?
Posts: 344
Damn, I really need this! How do I apply this patch?
Posts: 13
I know it's probably a long shot posting this here looking at the dates but does anyone know how to apply this patch?
Posts: 80
Sergii, Servantes, How do I apply this patch?
Does this patch finally enable you to mass change keywords and titles with the bulkmanage?
Posts: 17
Its supposed to work just by using some kind of commandline statement, that would change the lines in the original files so as to achieve these new functionalities.
I was just in your same situation so I finally decided to open the patch file with the notepad and change, one by one, every line of code. It didnt work at first, but as I ve been programming for some time...got it to work. If you see the dates...there was 1 month between the "how to" and the "working!" messages.
So all I can tell you is to change the code lines one by one...and it will work!
Posts: 16
right, you can do it manually. or you can use google:
http://www.google.com/search?q=how+to+apply+a+patch
http://www.google.com/search?q=how+to+apply+a+patch+on+windows
you will need patch.exe program
Posts: 35
Could you please advise roughly were the following lines of code from the patch go.
Its in the file CustomFieldItemEdit.tpl.
Roughly what line number, etc.
+
+function enabledisable(checkbox, name) {
+ var elem=document.getElementsByName(name).item(0);
+ elem.disabled = ! checkbox.checked;
+}
+
I know in the patch file it has what comes before/after the code you need to insert, but I can't find where to insert it.
Thanks!
Posts: 16
anywhere. it's javascript, so make sure to put it inside <script> tag. actually inside
<script type="text/javascript">
// <![CDATA[
{literal}
... javascript here ...
{/literal}
// ]]>
Posts: 35
Thanks.
I had everything except for that.
I will test it out and see if it works.
Posts: 35
Just tested it.
Had a problem.
After I enter in my information on the edit albums custom fields page, and click save, the page goes blank with www.mysite.com/gallery2/main.php in the address bar.
Tried in IE7 and FF(2.0), same problem.
I have attached the files I edited in hope that you could check the coding to see if its all correct.
Thanks.
Posts: 16
the patch was for gallery 2.1, it'll need changes for 2.2
e.g. error handling was changed, in 2.1 it used to be
if ($ret) {
return array($ret->wrap(__FILE__, __LINE__), null, null, null);
}
in 2.2. it's
if ($ret) {
return array($ret, null, null);
}
if all you see is an empty page, check httpd logs to see what went wrong, there should be php errors in there
Posts: 35
Updated new files with correct 2.2 code.
Still have the blank page problem.
Sorry, how can I check the httpd logs?
Posts: 40
Luke, I know this is an old post but you chopped out the saveFieldValues function from CustomFieldHelper.class. Seems to work fine in g2.3.