Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect row count on nested subforms #22757

Merged
merged 2 commits into from
Nov 5, 2018
Merged

Commits on Oct 21, 2018

  1. This commit fixes issue joomla#22441

    We were incorrectly using the lastRowNum property inside of the subformRepeatable object due to
    legacy reasons (the logic using a lastRowNum property has been overtaken from history, see commit
    f2a9874 ).
    
    What happened is that we always were incrementing the lastRowNum property by 1 inside of the
    fixUniqueAttributes method, whilest we call that method multiple times recursively, when we have
    nested subforms. So having a 2-level subform meant we would increment the lastRowNum twice for every
    added row, effectively meaning we would skip certain indices and hence totally lose the connection
    between the actual count of existing rows and their index. Actually we do not need the lastRowNum
    property, as the current logic works well without it just by calculating the count of rows directly
    in the addRow method. So removing the lastRowNum property is the best solution.
    
    See also issue joomla#22690
    Rene Pasing committed Oct 21, 2018
    Configuration menu
    Copy the full SHA
    d747b90 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f4ca1f8 View commit details
    Browse the repository at this point in the history