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: [Dave] Undefined index: createdByUserNum......

By philb - June 18, 2008 - edited: June 18, 2008

Hi Dave,

I'm not using template and I don't know about the joinTable option.

This is what I did.

1- In section Editor I created a new multi-record Editor;
2- Added the fields I needed;
3- Set the other tabs, Viewers URL, Searching, Sorting & Advanced;
4- Got the code selecting List Page.
5- Created a simple test page with the code and modifying it to display the way it will be (simple test no css);
6- Uploaded the file (http://www.pb3d.com/test/ventes_de_lotsList.php).

I just bought your cms yesterday and I'm doing some test to see if it will be OK for my project.
So far it's a wonderful piece of software and I wish I add found it earlier.

Thanks for your time

Philippe
Attachments:

ventes_de_lotslist.php 2K

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