1. NOTICE: If you are using Fabrik and update to Joomla 3.10, you will need to update to Fabrik 3.10. And, if you are using Fabrik, do not upgrade to Joomla 4, we do not have a supported version ready for release. More information on a release date coming soon. Also, please note that Fabrik 3.10 will not install on any Joomla sites less than 3.8.
    Dismiss Notice

isAdmin removed from J4

Discussion in 'Community' started by achartier, Oct 9, 2021.

  1. achartier

    achartier Active Member

    Level: Community
    The Application::isAdmin() function is no longer available in J4. it has been replaced by Application::isClient('administrator'). I have submitted PR https://github.com/Fabrik/fabrik/pull/2251 which replaces all occurrences of isAdmin with the new call.
     
  2. lousyfool

    lousyfool Active Member

    Level: Community
    As it says here above, "do not upgrade to Joomla 4, we do not have a supported version ready for release".

    Thanks for the hint and PR, there'll certainly be a lot more to do... ;)
     
  3. achartier

    achartier Active Member

    Level: Community
    I am just playing, I know J4 support has not been announced, but anything we can do to help speed it along I think is worthwhile.
     
    lousyfool likes this.
  4. lousyfool

    lousyfool Active Member

    Level: Community
    Yeah, cool.

    My reply was aimed more at other readers here, who might assume that Fabrik for J!4 is “around the corner” or so…
     
  5. troester

    troester Well-Known Member Staff Member

    Level: Community
    Is this change backward compatible with Joomla versions < 3.10 ?
     
  6. achartier

    achartier Active Member

    Level: Community
    Reading through that github issue it appears that isClient($identifier) is supported on all 3.x versions. If true then this change is backward compatible.
     
  7. juuser

    juuser Well-Known Member

    Level: Community
    I really appreciate the effort, but I see no need for adding Joomla 4 related stuff into 3.10 as the Fabrik 4 will be very likely a totally new branch where all this stuff will be included anyway. Especially when it's not 100% sure it will not break anything for users with older versions of Joomla.
     
    Last edited: Oct 12, 2021
  8. lousyfool

    lousyfool Active Member

    Level: Community
    You'll have to admit, for a number of reasons it'd be hugely (hugh-ly? lol...) preferable if a new Fabrik version were compatible with both J!3 and J!4 -- just like other extensions.
     
    Last edited: Oct 12, 2021
  9. lousyfool

    lousyfool Active Member

    Level: Community
    However, discussing J!4-related stuff in length or details here in the F 3.1 forum... yeah, that might well be the "wrong" place... ;)
     
  10. troester

    troester Well-Known Member Staff Member

    Level: Community
    I think @achartier is correct, his PR replaces "isAdmin" (which is not longer supported in J!4) with "isClient('administrator')" which is already supported in J!3.whatever (I just tested one place in my J!3.9.28).

    So I think the PR is "mergable" into Fabrik3. 10/J!3.10 but it should be a decision of Mediateam
     
  11. achartier

    achartier Active Member

    Level: Community
    A question for Mediateam then is, is there a development branch for Fabrik on Joomla 4 that we can play with and PR against as we find things? Or do we simply PR against the current master?

    I just now discovered that JVersion->RELEASE is no longer supported in J4. There are 33 places in the code where this is used.
     
  12. troester

    troester Well-Known Member Staff Member

    Level: Community
    There are two J40 branches in GitHub, but pretty old (May 2019), no idea what @mediaateam is doing internal meanwhile.

    BTW: I just found a commit "Alpha 8 removed CMSApplication->isAdmin() so have to use ->isClient('…
    …administrator')" there ;)
     
  13. achartier

    achartier Active Member

    Level: Community
    I have submitted two more PRs for J4 compatibility, both should run fine on J3.x (J3.10 for sure). One changes the use of JVersion as JVersion->RELEASE is no longer supported, the second changes JString and JStringNormalise to their namespaced equivalents.
     

Share This Page