Hello everyone,
My name is Ed. This is my first post to the mail list. I hope I'm doing it right.
I installed wikimedia, cargo and semantic forms all from git. I attempted to recreate the books/authors example and I run into trouble. Can you help?
This is what I did:
1) Created the Book template: <noinclude> {{#cargo_declare:_table=book|authors=List (,) of Page|genre=List (,) of Text|year_of_publication=Date|number_of_pages=Integer}} </noinclude><includeonly>{{#cargo_store:_table=book|authors={{{authors|}}}|genre={{{genre|}}}|year_of_publication={{{year_of_publication|}}}|number_of_pages={{{number_of_pages|}}} }}{| style="..." ! style="text-align: center; background-color:#ccccff;" colspan="2" |<big>{{PAGENAME}}</big> |- ! Author | {{#arraymap:{{{authors|}}}|,|x|{{#formredlink:form=Author|target=x}}}} |- ! Genre | {{{genre|}}} |- ! Year of publication | {{{_of_publication|}}} |- ! Number of pages | {{{number_of_pages|}}} |} [[Category:Books]] </includeonly>
2) I created the Author template: <noinclude> {{#cargo_declare:_table=author|country_of_origin=Text}} </noinclude><includeonly>{{#cargo_store:_table=author|country_of_origin={{{country_of_origin|}}} }}{| style="..." ! style="text-align: center; background-color:#ccccff;" colspan="2" |<big>{{PAGENAME}}</big> |- ! Country of origin | {{{country_of_origin|}}} |- ! Books | {{#cargo_query:tables=Book|where=Authors HOLDS "{{PAGENAME}}"}} |} [[Category:Authors]] </includeonly>
3) I used the "create cargo tables" option under each template to create the cargo tables: wiki_cargo__author wiki_cargo__book wiki_cargo__book__authors wiki_cargo__book__genre
4) Although not present in the quick start cargo page I create one form for Book: <noinclude> {{#forminput:form=Book}} </noinclude><includeonly> <div id="wikiPreview" style="..."></div> {{{for template|Book}}} {| class="formtable" ! authors: | {{{field|authors}}} |- ! genre: | {{{field|genre}}} |- ! year_of_publication: | {{{field|year_of_publication}}} |- ! number_of_pages: | {{{field|number_of_pages}}} |} {{{end template}}} '''Free text:''' {{{standard input|free text|rows=10}}} {{{standard input|summary}}} {{{standard input|minor edit}}} {{{standard input|watch}}} {{{standard input|save}}} {{{standard input|preview}}} {{{standard input|changes}}} {{{standard input|cancel}}} </includeonly>
5) And one for Author: <noinclude> {{#forminput:form=Author}} </noinclude><includeonly> <div id="wikiPreview" style="..."></div> {{{for template|Author}}} {| class="formtable" ! country_of_origin: | {{{field|country_of_origin}}} |} {{{end template}}} '''Free text:''' {{{standard input|free text|rows=10}}} {{{standard input|summary}}} {{{standard input|minor edit}}} {{{standard input|watch}}} {{{standard input|save}}} {{{standard input|preview}}} {{{standard input|changes}}} {{{standard input|cancel}}} </includeonly>
============================= ISSUE #1: ============================= When I create an author it all works. But when I attempt to create a book I get the following error: Error: table "Book" not found.
============================= ISSUE #2: ============================= When I edit the authors (which have been written in the wiki_cargo__author table) I get a regular wiki page as opposed to a copy of the form that was used to create it. {{Author |country_of_origin=US }}
These are the contents of the main cargo tables:
mysql> select * from wiki_cargo_tables; | template_id | main_table | field_tables | table_schema | 7 | book | a:2:{i:0;s:13:"book__authors";i:1;s:11:"book__genre";} | a:4:{s:7:"authors";a:3:{s:4:"type";s:4:"Page";s:6:"isList";b:1;s:9:"delimiter";s:1:",";}s:5:"genre";a:3:{s:4:"type";s:4:"Text";s:6:"isList";b:1;s:9:"delimiter";s:1:",";}s:19:"year_of_publication";a:1:{s:4:"type";s:4:"Date";}s:15:"number_of_pages";a:1:{s:4:"type";s:7:"Integer";}} | 8 | author | a:0:{} | a:1:{s:17:"country_of_origin";a:1:{s:4:"type";s:4:"Text";}}
mysql> select * from wiki_cargo_pages; | page_id | table_name | 12 | author | 14 | author
Any help will be greatly appreciated.
Thanks!!