Forum OpenACS Development: Re: xowiki 0.39

Collapse
10: Re: xowiki 0.39 (response to 9)
Posted by Malte Sussdorff on
The util_user_message needs to go within the if statement, not right before (otherwise it shows up all the time, which does not make sense). I modified it a bit to allow automatic creation of new pages:

          # Item is still empty, try default language for the package
          if {$item_id == 0} {
              set new_url [export_vars -base "/xowiki/" -url {{edit-new 1} {return_url [ad_return_url]} {object_type "xowiki::Page"} {na\me $name}}]
              util_user_message -message "Content is not available in your locale. Create <a href=\"$new_url\" target=new()>new</a>" -ht\ml
              set system_locale [lang::system::locale]
              set lang [string range $system_locale 0 1]
              set name ${lang}:$local_name
              set item_id [::Generic::CrItem lookup -name $name -parent_id $folder_id]
          }

What I found interesting though is that if I unpublish the item in question (e.g. en:company), the page is still showing up the en:company page, instead of (as I would have assumed) the de:company page with the user notification. If I delete the page in question all is fine.

My assumption is that ::Generic::CrItem lookup -name $name -parent $folder_Id does not query for published items and could use a "-live" flag to query only items which are live. But I won't dive down into these waters :).

Collapse
11: Re: xowiki 0.39 (response to 10)
Posted by Gustaf Neumann on
malte, before i look into the details: can it be, that a setting in the folder_object like

set index_page "en:index"

causes the confusion?

-gustaf

Collapse
12: Re: xowiki 0.39 (response to 11)
Posted by Malte Sussdorff on
Yeah. You were absolutely right. That was it. Now I know: First check the folder object than check the parameters... Maybe we could have a warning on the parameters page like "YOU HAVE TO CHECK THE FOLDER OBJECT HERE" 😊.

I could not figure out in the documentation if you can say in an xowiki page directly which folder object to use, so you could have different settings depending on page. I solved this so far by just mounting a different xowiki instance (http://www.cognovis.de/developer) which is only available in English and therefore has different settings in the folder object for language etc.. Did I do this unnecessarily ?