Zotonic
Zotonic
zotonic@conference.zotonic.com
Tuesday, 31 July 2012< ^ >
arjan has set the subject to: Zotonic - the Erlang CMS
Room Configuration

GMT+2
[07:33:21] arjan joins the room
[08:04:33] arjan leaves the room
[08:30:28] arjan joins the room
[08:42:50] Ilya Rezvov leaves the room
[08:57:43] kaos joins the room
[08:57:59] Ilya Rezvov joins the room
[08:58:11] <kaos> Hi Ilya Rezvov
[08:58:24] <kaos> I see your question from last night...
[08:59:34] <kaos> and even though I don't have direct experience with searches, I think you should be able to achieve what you want with a custom search
[08:59:53] <kaos> I'll dig up some documentation...
[09:04:13] <kaos> OK, look at this thread from the mailing list: https://groups.google.com/forum/?fromgroups#!topic/zotonic-users/iibKvGVqgr4
[09:04:52] <kaos> that's the closest match I could find at the moment. Noting that the docs doesn't cover this topic...
[09:05:05] <Ilya Rezvov> i see the code
[09:05:36] <Ilya Rezvov> and it has not ways search by standard search model
[09:06:16] <Ilya Rezvov> only with adding my custom pivot_* column and join with custompivot
[09:08:27] <kaos> I'm not entirely sure I got what you were saying. But read through the thread I linked to and see if you find something useful for you in there... ;)
[09:09:07] <kaos> otherwise see if you can get more info from arjan or Marc...
[09:09:30] <Ilya Rezvov> thx :)
[09:09:54] <kaos> np :)
[09:10:25] <Marc Worrell> i think we should get Arjan in, he made the custom pivot stuff.
[09:10:45] <Marc Worrell> would be nice to be able to search them using the normal query model, without extra coding.
[09:10:48] <arjan> Ilya Rezvov: what exactly do you want to achieve?
[09:11:01] maas.maarten.zeeman joins the room
[09:11:38] <Ilya Rezvov> i want search by custom field of rsc
[09:11:43] <Ilya Rezvov> price for example
[09:12:48] <Ilya Rezvov> it stored in props field
[09:13:00] <arjan> yes
[09:13:14] <arjan> those fields are indeed not searchable by default
[09:13:24] <arjan> see my answer of jan 21 in the thread that kaos mentioned
[09:13:27] <arjan> that explains the procedure
[09:13:41] <Ilya Rezvov> ok, thx
[09:13:42] <arjan> I agree it is quite some work
[09:14:42] <Ilya Rezvov> some documentation would have been nice :)
[09:17:41] <kaos> arjan: https://git.process-one.net/ejabberd/mainline/blobs/raw/v2.1.11/doc/guide.html#htoc49 :D
[09:29:31] <Ilya Rezvov> arjan: if i want search by 2 properties, how i must write my do_custom_pivot function?
[09:30:13] <Ilya Rezvov> i must return list with 2 tuples?
[09:30:17] <Ilya Rezvov> in each call
[09:32:54] <arjan> im not sure actually
[09:33:51] <arjan> kaos: this chatroom already logs from november 11
[09:34:02] <arjan> only the logs are still not available online
[09:34:37] <kaos> ah, nice :) so not too much work to get them online, I suppose... ?
[09:35:39] <kaos> no rush, was just thinking... :)
[09:37:08] <kaos> I know we said "no css" for bootstrap in mod_base. But wouldn't it be useful to at least include the css shipped with bootstrap?
[09:41:32] <arjan> yeah sure
[09:42:22] <Marc Worrell> ok
[09:42:53] <Marc Worrell> or do we need a mod_bootstrap? :p
[09:44:36] <kaos> I think a mod_bootstrap could be nice. Then we could have some additional supporting files to help (re)build it and ease keeping it in sync with up-stream...
[09:44:55] <kaos> was just looking at how to build bootstrap.
[09:45:09] <kaos> to know what came with the distro and what has been added by us...
[09:46:21] <kaos> or maybe just incorporate something in zutils to rebuild bootstrap, and put the compiled stuff in mod_base
[09:47:05] <kaos> I wouldn't want to pull in the deps for building bootstrap into zotonic..
[09:49:11] <arjan> agree
[10:05:25] <kaos> I'll push my work on the status site regularly to https://github.com/kaos/zotonic/tree/sa/status-site - when I'm "done" I'll let you have a look before I merge it into zotonic/master...
[10:13:33] <arjan> nice
[10:15:09] <Marc Worrell> you might also want to check "responsive.js" in mod_base_site
[10:15:30] <Marc Worrell> it handles the menu changes in responsive sites, to hide the submenus when the menu is collapsed.
[10:20:06] <kaos> Marc Worrell: are you suggesting to also move that into mod_base?
[10:20:22] <kaos> or to have it in zotonic_status?
[10:23:19] <Marc Worrell> i think it is a useful addition for building zotonic sites with bootstrap, so should be where we are including bootstrap.
[10:23:25] <Marc Worrell> mod_bootstrap or mod_base
[10:24:14] <Marc Worrell> mod_bootstrap might be better
[10:24:31] <Marc Worrell> splitting functionalities, concerns and whatnots
[10:24:40] <Marc Worrell> expecially the whatnots
[10:24:45] <Marc Worrell> eSpecially
[10:30:30] <kaos> has the added benefit of making it easier to choose what library one wants to use for each site... :)
[10:30:43] <kaos> I'll add a mod_bootstrap...
[11:52:24] <kaos> I didn't look at the responsive.js...
[11:53:03] <arjan> I'll look at it in a bit
[11:53:08] <arjan> (the pull req)
[11:53:24] <kaos> :)
[11:59:27] <Marc Worrell> responsive.js and other zotonic additions we can move in later.
[11:59:54] <Marc Worrell> just added a note about the prio of the module.
[12:01:04] <kaos> fixed :)
[12:01:11] <arjan> go go go
[12:01:12] <Marc Worrell> :) yeah
[12:01:12] <arjan> :)
[12:01:31] Marc Worrell cheers, while kaos is heading to the big merge button
[12:01:51] kaos was beaten by arjan :p
[12:01:59] <arjan> what?
[12:02:12] <kaos> you beat me to the big merge button... ;)
[12:02:17] <arjan> no I didnt merge it yet..!
[12:02:25] <arjan> just added a comment
[12:02:27] <kaos> oh , miss read the status page...
[12:02:30] <arjan> :)
[12:02:35] <arjan> just need to reload and then merge
[12:02:44] <arjan> github is not yet realtime :)
[12:05:06] kaos merged the status site fixes... :)
[12:09:25] <Marc Worrell> Joost's baby girl has been born
[12:09:26] <Marc Worrell> http://www.facebook.com/joost.faber
[12:11:09] <kaos> congrats :)
[12:11:30] <arjan> nice
[12:13:29] <kaos> I've created an empty site, but when I load a page I get
[12:13:38] <kaos> 2012-07-31 10:08:18.720 [error] <0.3677.0> CRASH REPORT Process <0.3677.0> with 0 neighbours crashed with reason: bad argument in {erlang,binary_to_list,[undefined],[]}
[12:13:53] <Marc Worrell> yuck, that doesn't help a lot, does it?
[12:13:55] <kaos> recognize that? or do I need to dig into this...
[12:14:05] <kaos> no, no context what so ever.. :/
[12:14:07] <Marc Worrell> doesn't ring a bell
[12:14:26] <Marc Worrell> maybe somewhere in the not-so-iolist for the homepage?
[12:14:28] <kaos> ok, I'll see what I can find
[12:14:56] <Marc Worrell> at least the process had a free standing house when it crashed, no neighbours affected
[12:14:57] <kaos> well.. at first, it was *really* empty... was thinking it may even be db connection issues...
[12:15:25] <Marc Worrell> maybe we need a kind of page that checks the health of a site? one that you can load in the site.
[12:15:44] <kaos> hah.. yep. but no one seems to monitor the process either, because I don't get any crasher for subsequent requests...
[12:16:27] <Marc Worrell> hmmm
[12:16:30] <kaos> well, something is needed. I have no clue what's wrong - maybe I can add something once I've figured it out
[12:16:44] <kaos> to guard against it in the future...
[12:16:44] <Marc Worrell> yes, we need better debugging stuff anyway
[12:16:53] <Marc Worrell> Erlang can crash in mysterious ways
[12:17:00] <kaos> indeed
[12:20:14] <Marc Worrell> i was also thinking of a better template-inheritance-debugger
[12:20:56] <Marc Worrell> a window where you can see what templates are used in another window, and then highlight where they are, where they came from and what their arguments where.
[12:21:28] <Marc Worrell> were
[12:21:41] <kaos> I've been thinking of a dispatch viewer so you can see all rules and where they come from
[12:21:50] <Marc Worrell> should be possible by inserting <script /> tags on the correct template boundaries
[12:22:01] <Marc Worrell> yeah, dispatch viewer is needed as well
[12:22:19] <Marc Worrell> we need a kind of 'debug' state for a session
[12:22:25] <kaos> I feel lager is holding out information from me.
[12:22:28] <Marc Worrell> maybe we can then monitor that session in another browser
[12:22:42] <kaos> It says crash report. But crash reports usually holds a lot more than one line.
[12:22:52] <kaos> that would be awesome :)
[12:23:08] <Marc Worrell> that would be a killer feature :)
[12:33:53] <kaos> ah, yes. oh, dear lager. I added {error_logger_redirect, false} to priv/erlang.config and got my reports in the console. yay. only to find that they...
[12:34:06] <kaos> had been logged all along in priv/sasl/crash.log
[12:34:15] <kaos> heh
[12:35:52] <kaos> now I have something to dig into (after lunch) exception error: bad argument: [{erlang,binary_to_list,[undefined],[]},{z_sites_dispatcher,dispatch,3,[{file,"src/support/z_sites_dispatcher.erl"},{line,92}]},{webmachine_mochiweb,loop,2,[{file,"src/webmachine_mochiweb.erl"},{line,87}]},{mochiweb_http,headers,5,[{file,"src/mochiweb_http.erl"},{line,136}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]
[12:45:43] <Marc Worrell> huh? in the dispatcher?
[12:46:07] <Marc Worrell> that is a new one
[13:13:18] <kaos> lol, ok. Back from lunch now. See if I can find the root cause...
[13:16:32] <kaos> ok, it's because m_rsc:p_no_acl(Id, default_page_url, Context) returns undefined...
[13:16:42] <kaos> now, why is that ?...
[13:22:04] <Marc Worrell> guess the resource isn't there?
[13:22:44] <Marc Worrell> prob the resource with name 'home_page' (or was it page_home?)
[13:23:26] <Marc Worrell> we should make that more robust.
[13:24:07] <kaos> but Id is integer...
[13:24:56] <kaos> got stuck trying to remember the name of a project wrapping the erlang trace functions to ease debugging from the console...
[13:26:15] <kaos> but, sure. it could be made more robust there... perhaps I should focus on robustify it, and it should tell me what's wrong when I got it right... :)
[13:28:50] <kaos> btw, on line 90 in z_sites_dispatcher, why is there a is_integer guard there? m_rsc copes with atoms just fine...
[13:39:01] <kaos> the rsc is there... I'm starting to think it may be some dispatch rule that may be missing...
[13:39:29] <kaos> or, to put it differently, I tried the above for page_home, and got an undefined page url back...
[13:40:38] <kaos> got a real nice thunder storm here now, with lightning, thunder and hail :)
[14:06:19] <kaos> (zotonic001@morpheus.local)5> m_rsc:p_no_acl(312, default_page_url, C).
=INFO REPORT==== 31-Jul-2012::12:05:52 ===
make_url_for: no dispatch rule named `text'.
=INFO REPORT==== 31-Jul-2012::12:05:52 ===
make_url_for: no dispatch rule named `page'.
undefined
[14:07:32] <Marc Worrell> oh, that is for the rss feed!
[14:07:45] <Marc Worrell> we should just skip that thing when there is no dispatch rule
[14:07:52] <Marc Worrell> hmmm
[14:07:59] <Marc Worrell> no, that is for 312
[14:08:13] <Marc Worrell> we removed the default page url from mod_base
[14:08:19] <Marc Worrell> need to put it somewhere else
[14:08:21] <kaos> 312 == page_home
[14:08:44] <kaos> ah...
[14:08:46] <Marc Worrell> then this is for the alternative urls (or something similar)
[14:09:06] <Marc Worrell> some people didn't want to have /page/xxx/bla
[14:09:17] <Marc Worrell> and they always had it because of mod_base
[14:09:25] <kaos> ok. so it is a dispatch bug (config or otherwise)
[14:09:40] <kaos> I just pushed a fix to log when this hits you
[14:10:04] <Marc Worrell> good
[14:10:35] <Marc Worrell> that the first one misses is not too bad though, we almost always fall back to 'page'
[14:10:43] <Marc Worrell> that that one misses is a problem
[14:11:07] <kaos> ok, so where do we want to put it. in mod_base_site perhaps?
[14:14:00] <kaos> ah, mod_base_site already has them... so I should perhaps enable that module...
[14:25:15] <kaos> Marc Worrell: I might have messed up the bootstrap css files for base site a bit...
[14:25:44] <kaos> you have made some customizations to bootstrap.css, but those changes are hard to maintain when upgrading bootstrap...
[14:30:03] <kaos> hmm... there's a whole bunch of requests to make_url_for that doesn't have a dispatch rule. so there's a little much messages going on...
[14:31:47] <kaos> Yay, I got into the 0.9-dev admin! :D
[14:42:14] <Marc Worrell> yeah :)
[14:42:31] <Marc Worrell> yes, problem with bootstrap is that you have to modify the original css file
[14:42:36] <Marc Worrell> very hard to maintain
[14:42:51] <kaos> why is the page dispatch rule required to get the / path ?
[14:43:40] <kaos> @bootstrap: well , that sounds less than ideal...
[15:26:06] <Marc Worrell> I am not sure why the dispatch rule is needed… is it part of the dispatch or of the page generation?
[15:26:56] <Marc Worrell> or wait… it is probably needed because there is no '/' dispatch rule.
[15:27:10] <Marc Worrell> Then the page_home is taken because of its page_url
[15:27:48] <Marc Worrell> It is then rendered as a normal page using an internal redirect to the correct webmachine resource, using the dispatch rule the page would have had if there was no page_url property set.
[15:28:27] <Marc Worrell> interesting construct, isn't it? :)
[17:21:01] <kaos> wow. but yeah, sounds about right. :)
[17:21:25] <Ilya Rezvov> arjan: i added do_custom_pivot function and pivot_mysite table was created and filled, but i don't understand how i can search by custom pivot
[17:22:25] <Ilya Rezvov> i try to search like m.search[{ query cat="product" page=page pagelen=12 custompivot="mysite" price="10" }]
[17:26:33] <Ilya Rezvov> where is expessions like [{ query cat="product" page=page pagelen=12 custompivot="mysite" price="10" }] transform to erlang terms?
[17:28:16] <arjan> that is done somewhere in mod_search;
[17:28:33] <arjan> support/search_query.erl
[17:29:22] <arjan> im actually not sure if filtering on custom pivot is possible like that
[17:29:46] <arjan> usually I create a observe_search_query handler to handle searches
[17:30:43] <Ilya Rezvov> when it will be called?
[17:31:01] <Ilya Rezvov> or where i can find example
[17:31:17] <arjan> for observe_search_query?
[17:31:22] <Ilya Rezvov> it is critical thing for ecommerce site
[17:31:26] <Ilya Rezvov> yeah
[17:31:27] <arjan> see mod_search for the default searches
[17:31:31] <Ilya Rezvov> thx
[17:31:54] <arjan> you can return a #search_sql{} record containing your custom joins, filters, etc
[17:33:28] maas.maarten.zeeman leaves the room
[17:37:01] <Ilya Rezvov> it is cool, but i for beginning i must understand how parse query from template
[17:49:09] arjan leaves the room
[17:58:39] <Ilya Rezvov> https://gist.github.com/3218032 this code fall in infinite recursion
[17:59:16] <Ilya Rezvov> how i can renotify call to modules with low priority
[18:00:38] <kaos> line 6 should probably just return undefined.
[18:00:52] <Ilya Rezvov> thx
[18:00:58] <kaos> that lets z_notifier to try the next handler
[18:01:02] <Ilya Rezvov> i understand it already :)
[18:01:23] <kaos> ok
[18:01:30] <Ilya Rezvov> reading documentation usefull sometimes :)
[18:27:45] arjan joins the room
[19:30:45] <kaos> hmmm... the indentation for categories (admin/category) seems off...
[19:51:29] Ilya Rezvov leaves the room: Replaced by new connection
[19:51:30] Ilya Rezvov joins the room
[20:01:28] Ilya Rezvov leaves the room
[20:01:33] <Marc Worrell> oops, they are more than off - complete failure due to my changes for the menu editor!
[20:02:08] <Marc Worrell> I'll make an issue for this one
[20:02:17] <Marc Worrell> needs a fix :s
[20:02:37] Ilya Rezvov joins the room
[20:16:59] <Marc Worrell> Another gmake/make issue, from Solaris 10. Received it some time ago, added it as a (Ducth!) issue in github
[20:16:59] <Marc Worrell> https://github.com/zotonic/zotonic/issues/379
[20:20:32] arjan leaves the room
[20:20:44] arjan joins the room
[20:26:27] Ilya Rezvov leaves the room
[20:28:14] arjan leaves the room
[20:29:36] Ilya Rezvov joins the room
[20:38:58] <kaos> Marc, do you know why the layers flatten is passed to convert in z_media_preview?
[20:40:00] <kaos> I have a slightly older version of image magick that doesn't support layers flatten. And I commented it out, and it seems to work just fine, at least for my jpg's. Guess there are other formats where it could be useful to have...
[20:48:42] <Marc Worrell> i think that without it I got some strange results with layered files, I do remember experimenting with it and needing it at some point
[20:48:57] <Marc Worrell> maybe check pngs with alpha channels
[20:49:02] <Marc Worrell> or psd files
[20:53:19] Ilya Rezvov leaves the room
[20:57:33] <kaos> ok. I'll leave it off for my install. perhaps apply it a little more selective than for "all except gif & png"...
[21:11:57] arjan joins the room
[21:16:46] arjan leaves the room
[23:13:19] kaos leaves the room
[23:20:13] Ilya Rezvov joins the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!