[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"

AttachmentSize
customfield-bulk.diff_.txt7.03 KB
 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Sat, 2006-11-04 13:48

Hey, thanks for the patch! It's tested on current svn version, right?

 
sergii

Joined: 2006-10-29
Posts: 16
Posted: Sat, 2006-11-04 15:50

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.

 
cervantes_roger

Joined: 2006-10-25
Posts: 17
Posted: Mon, 2006-11-13 16:20

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

 
cervantes_roger

Joined: 2006-10-25
Posts: 17
Posted: Mon, 2006-12-11 17:43

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

 
briancoy

Joined: 2005-06-24
Posts: 3
Posted: Mon, 2007-01-01 04:22

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

 
gioiam

Joined: 2007-07-02
Posts: 5
Posted: Wed, 2007-07-18 23:59

Can someone please explain to me how i apply this patch?

 
skunker

Joined: 2005-02-04
Posts: 344
Posted: Sun, 2007-11-11 02:34

Damn, I really need this! How do I apply this patch?

 
kingstog

Joined: 2007-10-08
Posts: 13
Posted: Thu, 2007-12-06 02:12

I know it's probably a long shot posting this here looking at the dates but does anyone know how to apply this patch?

 
desiredbard

Joined: 2006-07-05
Posts: 80
Posted: Thu, 2008-01-24 12:35

Sergii, Servantes, How do I apply this patch?

Does this patch finally enable you to mass change keywords and titles with the bulkmanage?

 
cervantes_roger

Joined: 2006-10-25
Posts: 17
Posted: Thu, 2008-01-24 13:22

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!

 
sergii

Joined: 2006-10-29
Posts: 16
Posted: Thu, 2008-01-24 14:47

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

 
Luke7799

Joined: 2007-07-10
Posts: 35
Posted: Fri, 2008-01-25 04:50

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!

 
sergii

Joined: 2006-10-29
Posts: 16
Posted: Fri, 2008-01-25 10:52

anywhere. it's javascript, so make sure to put it inside <script> tag. actually inside

<script type="text/javascript">
// <![CDATA[
{literal}

... javascript here ...

{/literal}
// ]]>

 
Luke7799

Joined: 2007-07-10
Posts: 35
Posted: Fri, 2008-01-25 20:05

Thanks.
I had everything except for that.
I will test it out and see if it works.

 
Luke7799

Joined: 2007-07-10
Posts: 35
Posted: Sat, 2008-01-26 09:29

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.

 
sergii

Joined: 2006-10-29
Posts: 16
Posted: Sat, 2008-01-26 20:32

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

 
Luke7799

Joined: 2007-07-10
Posts: 35
Posted: Sun, 2008-01-27 10:35

Updated new files with correct 2.2 code.
Still have the blank page problem.

Sorry, how can I check the httpd logs?

 
Another_Matt

Joined: 2009-08-20
Posts: 40
Posted: Thu, 2009-10-08 18:13

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.