Undefined index: createdByUserNum......

6 posts by 2 authors in: Forums > CMS Builder
Last Post: June 18, 2008   (RSS)

By philb - June 18, 2008

Hi,

I have created a simple page showing the items of a list.
At the top of the page (showing the list) I get this error for every entry -if there is 15 items it will show 15 times in a row-:
Notice: Undefined index: createdByUserNum in /home/xxxx/public_html/cmsAdmin/lib/viewer_functions.php on line 198


Thanks

Philippe

Re: [philb] Undefined index: createdByUserNum......

By Dave - June 18, 2008

Hi Philippe,

Are you using the 'joinTable' option or working with the sample realty templates? If so, try removing the 'joinTable' option.

If that's not it, can you attach your viewer to the post so I can have a look? Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [philb] Undefined index: createdByUserNum......

By Dave - June 18, 2008

Great description, that made it really easy for me to reproduce. Thanks. :)

It's a bug. It happens when you don't have a 'createdByUserNum' field. By default the viewers will load in extra fields about the record creator such as createdBy.fullname, createdBy.email, etc.

I've added a fix for this to the next version. Here's how you can apply it now.

- Open /lib/viewer_functions.php
- Make a backup copy of that file.
- Search for "Add createdBy.fields to records" (around line 65)
- add the code in red to the line below it (or just replace the line)

if (@$options['loadCreatedBy'] && @$schema['createdByUserNum']) { _getRecords_joinTable($rows, $options, 'accounts'); }


Another approach is to just add this line (in red) to your viewer code:

list($ventes_de_lotsRecords, $ventes_de_lotsMetaData) = getRecords(array(
'tableName' => 'ventes_de_lots',
'loadCreatedBy' => false,
));


Let me know if either of those fixes it, and thanks for reporting this!

Hope that helps, let me know if you need anything else.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Undefined index: createdByUserNum......

By philb - June 18, 2008

WOW Dave!

This is what I call excellent service[;)]

I tried both fix and they both work.

I'm going to use the first one (the modification in the viewer_functions.php file).

With the update to fix this will I have to undo the change to the viewer_functions.php file or will the update contain a new viewer_functions.php?

Thanks for such good and fat response.

Philippe

Re: [philb] Undefined index: createdByUserNum......

By Dave - June 18, 2008

Glad to help! :)

The next version will have an updated viewer_functions.php so you won't need to worry about it. You can just overwrite the file.
Dave Edis - Senior Developer
interactivetools.com