[SOLVED] Unable to retrive Album Common Custom Fields

shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Wed, 2005-08-10 21:27

I am having a problem accessing the Album value for a common custom field. Commenting out line 247 of the CustomFieldHelper.class fixes my problem.

		    if (isset($viewType) && !$it[$viewType]) {
			//continue;
		    }

Has anyone else noticed this issue?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-08-11 02:55

accessing the value where? what are the steps you reproduce the problem?

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Thu, 2005-08-11 03:06

I have a common custom field called Price. I enter a value in the common custom field for both a photo and for a sub-album. When i'm displaying the album which contains both of the items holding the price I am only able to retrieve the price from the photo and not the album. But if I comment out that line I mentioned earlier I am able to retrive the value from both.

From inside the album.tpl in my custom theme, i'm calling the following while looping through all the children.

{g->callback type="customfield.LoadCustomFields" itemId=$child.id}

I am accessing the data like this

{php}echo $this->_tpl_vars['block']['customfield']['LoadCustomFields']['fields']['Price'];{/php}

I'm treating both albums and photos alike when dealing with the common custom fields. Let me know if you need any more information. Thanks.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Thu, 2005-08-11 03:11

BTW, I'm using gallery from jpmullen's site from 8-9-2005 after the custom fields bug was fixed.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-08-11 05:22

first of all, smarty syntax is:
{$block.customfield.LoadCustomFields.fields.Price}

is there some reason you aren't using item summaries to display this?
module.inc, getItemSummaries gets all the data at once..

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Thu, 2005-08-11 11:38

I'm displaying the price and i'm calling a php function where I need to pass the price into the function. Which is why i'm using the php way of accessing the data. I can break the displaying of the price out and the results are no different.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Thu, 2005-08-11 13:32

Would it have anything to do with the fact I don't have summary or detail checked when setting up these custom fields.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Thu, 2005-08-11 16:52

I verified that I still have the same problem with the albums no matter what is checked. Seems like the callback uses detail, so if you don't have that checked it won't get a photo or albums data using the callback. But even if you do have it checked it still doesn't get the albums data.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-08-11 21:28

do you have only global custom fields or any album-specific fields? make sure the subalbum also has detail checked for price if they are album-specific fields.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Thu, 2005-08-11 21:58

Well I thought I had only global fields but you are right, that subalbum did have it's own settings and reverting those settings to global fixed it. thanks for your help.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-08-11 23:31

cool, glad i could help :)