⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Create an alias of a column



Jubayer Arefin
  • profile picture
  • Member

Posted 26 June 2012 - 09:31 AM

So strange. I used your code but didnot get the result as expected. I am at a loss. :(

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 26 June 2012 - 09:59 AM

So what if you comment the set_relation?


// $crud->set_relation('category_id','categories','name');


The name appears at your table or still it is not appearing there?

Jubayer Arefin
  • profile picture
  • Member

Posted 26 June 2012 - 10:07 AM

Yes the name appears at the table but I don't get the category in the dropdown anymore.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 26 June 2012 - 12:19 PM

I will look at this deeper when I will find more time and I will inform you if I find something. Probably it is something small as I didn't have similar bug report for a long time. At least we will know WHAT cause this problem.

Jubayer Arefin
  • profile picture
  • Member

Posted 26 June 2012 - 12:35 PM

Okay. I will wait :) .Thnx a lot mate.

carlosT
  • profile picture
  • Member

Posted 29 June 2012 - 04:07 AM

Having exactly the same problem over here, just upgraded from 1.3 to 1.2.3 and it started happening. Unfortunately almost all my grids have the column 'name' and have relationships with columns using 'name' for the display field. I have tried all the callbacks possible even tried return "hello world"; and still nothing. It only happens in grid view, edit is fine. Would love to see a fix for this bug as I was just about to hand the project over to the client and i like the features of 1.2.3 too much to downgrade it back to 1.3 :(

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 29 June 2012 - 06:26 AM

Hello again [member='Jubayer Arefin'] and carlosT

A user had a similar problem and he solve it in this workaround: https://github.com/s...-crud/issues/71
Perhaps it should help. This bug will be fixed as for next version.

Jubayer Arefin
  • profile picture
  • Member

Posted 29 June 2012 - 06:58 AM

:D that solved my problem.

carlosT
  • profile picture
  • Member

Posted 02 July 2012 - 07:21 AM

Me too :) thanks Johnny!

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 02 July 2012 - 18:12 PM

Guys the bug is fixed and I also included it the version 1.2.3 as it was only one line. You can see the bug fix at: https://github.com/s...e1264c1decc84cd

Jubayer Arefin
  • profile picture
  • Member

Posted 03 July 2012 - 05:59 AM

It is just getting better and better. :)

kaosweaver
  • profile picture
  • Member

Posted 17 December 2012 - 14:19 PM

I am having a similar issue (which wasn't solved by the fix) - I have a main table (articles) with a sub table (Bio) where the articles can have 2 bio's attached to them - I link them via the "Author" column.
In Articles table we have:
Author - varchar
Author2 - varchar

In Bio we have:
Author - varchar

We're linked via the name string (and yes, I know we should be linked via the Bio table's key column, but that decision was made in 2001 about 11 years before I showed up).

In the CRUD setup we have:
$crud->set_table('news')
->set_subject('Articles')
->columns('Title','Author','Publish','x')

and
$crud->set_relation('Author','bio','Author');
$crud->set_relation('Author2','bio','Author');


The issue is on the first page (where the list of articles is shown) - the Author's column is empty.

It would be awesome to have the columns (or any other field) be able to be explicitly declared with a {table_name}.{field} declaration which would solve these issues, apart from that is there any chance of a work around which will work for me?