Jump to content

apeisa

Moderators
  • Posts

    4,631
  • Joined

  • Last visited

  • Days Won

    53

Posts posted by apeisa

  1. I just have simple edit link somewhere in site. I have found that as best solution for clients. I also never allow front end editing and keep client using admin as much as possible. 

  2. I am currently building first site using Wireframe. I really like it so far. I have almost done with the site (pretty simple one) and I didn't use any controllers... until now when I noticed that homepage shows feed that mixes news and events. Usually nothing too complex (just add both templates to selector), but in this case events are from separate system, pulled from REST API. So this was perfect case where I use controller for:

    • pulling data from external API
    • caching that data, so that we fetch only once in hour
    • merging and sorting it to one PageArray with local news items
    • passing that final PageArray to view file for easy rendering

    Without Wireframe I would probably build much of that logic into functions, but I really like that there is "documented place where this kind of stuff should live". 

    In future if I (or some other lucky fellow) need to make changes to layout - it is simple and one doesn't have to think about that "wow, all kinds of stuff is happening here", maybe remove that events stuff or add even more sources - I can do it easily without messing with layout. Also this model usually helps to produce clearer code: instead of many ifs (showing little bit different data for events vs. news) while rendering, I have that kind of logic separate from actual markup.

    One downside is of course that one have to "understand" the mvc-framework and it's logic. You have to know that there might be controller involved and where it lives for example.

    • Like 6
  3. Same feelings also. I think Teppo really said well how I felt also when read the latest post (and discussion about api examples). 

    That kind of optimization is nice per project, but it is really confusing for a platform that we use to maintain and build hundreds of websites and applications with multiple developers. 

    I'm all in for introducing breaking changes for 4.0. That would get rid of compiler also.

    • Like 7
    • Thanks 1
  4. On 6/1/2018 at 5:19 PM, BitPoet said:

    b) If all comments pages are at the same depth (or not too deeply nested) and each has a unique (might also be grand-) parent, you can create a field on those ancestors that holds the admin contact email and use the "field:" syntax in Admin notification email:

    @BitPoet I have totally missed this "field:createdUser.email" syntax. Is this documented somewhere and what are all the places that it can be used? Is it only module/field configs or some other places also?

  5. I have myself moved to use jumplinks module in our projects. This module is not actively maintained, but for some projects this simplicity just works. 

    Feel free to send pr, I might merge it (not sure if that has any unnecessary side effects?) but at least it is there if someone else has same need. 

  6. Thanks Teppo, looks great!

    The bugs I reported earlier were not fixed on these updates. That make me look more careful the server setup and the issue was that PW timezone was not the same that server was using - that caused history tab to work inproperly. Interesting thing is that the field specific compare/restore did work nicely even on bad configuration.

    • Like 2
  7. Sorry guys, haven't used (or developed) Fredi in years. I have no idea what it takes to fully support it in latest PW versions.

    First thing to try is to add <?php namespace ProcessWire; as a first line to each php file in the module to prevent PW from compiling the files.

    Probably the issue @lpa is describing is something to do with new PW features and requires proper debugging though. 

  8. Hi @teppo

    Finding out that there is also few more bugs with PW3:

    • revisions don't work - it always shows the latest version (the sliding preview or /setup/version-control/preview/?pages_id=1328&revision=511 urls). I did debug this quite a bit and this SQL generated by PageSnapshot::snapshot always returns Empty set (although there should be data and database seems to been populated fine):
    • SELECT t1.pages_id, t1.id AS revision, t2.fields_id, t2.property, t2.data
          FROM (
              SELECT MAX(t1.id) id, t1.pages_id, t2.fields_id
              FROM version_control__revisions AS t1, version_control__data AS t2
              WHERE t1.id = 513 AND t1.pages_id IN (1328) AND t1.timestamp <= FROM_UNIXTIME(1511771437) AND t2.revisions_id = t1.id
              GROUP BY t1.pages_id, t2.fields_id, t2.property
          ) AS t1
          INNER JOIN version_control__data AS t2
          ON t2.revisions_id = t1.id AND t2.fields_id = t1.fields_id
          GROUP BY t1.pages_id, t2.fields_id, t2.property

      In history tab clicking pagination also changes the tab (minor annoyance)

     

    I also updated this to PW3 (well, added namespace to each .module file and changed PDO references to \PDO, but that didn't had any affect to these bugs (didn't test the earlier image test though). Here are those attached if you are interested (didn't test that well and took about a minute or so).

    ProcessVersionControl.zip

    • Like 1
×
×
  • Create New...