PhenoApps / Field-Book

https://fieldbook.phenoapps.org
GNU General Public License v2.0
53 stars 54 forks source link

Skipping plots with missing data if the note was not the one most previously taken[REQUEST]: #987

Closed krfritz closed 4 months ago

krfritz commented 5 months ago

Description

When taking notes for two traits we would like to be able to jump to the next plot that is missing either trait not just skipping to the next plot that is missing data for the trait you currently have selected. For example when taking flowering time data we have silking date and anthesis date as our active traits but we also have stand counts loaded into Field Book as an unselected trait. We would like to skip to the next plot missing either silking OR anthesis data but currently if we select "Skip entries across active traits" if the last note we took was anthesis date it will skip to the next plot missing anthesis data even if there were plots in between that were missing silking date. Same if the last note was silking date it will jump to the next plot missing silking not catching any plots missing anthesis. If we select "Skip entries across all traits" it will skip no plots since stand count is in as a trait but had no saved notes currently.

I don't think that we were having this same issue last year and wonder if it has just been since the issue "Return to first trait when advancing to next plot #722" was resolved

Alternatives

No response

Additional Context

No response

trife commented 5 months ago

@krfritz I'll investigate this and hopefully be able to get a solution out asap.

@chaneylc It looks like the sort options are also out of order relative to their actions in the build I currently have installed.

trife commented 5 months ago

@bellerbrock

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
       at com.fieldbook.tracker.views.TraitBoxView.setSelection(TraitBoxView.kt:317)
       at com.fieldbook.tracker.views.RangeBoxView.checkSkipTraits(RangeBoxView.kt:743)
       at com.fieldbook.tracker.views.RangeBoxView.movePaging(RangeBoxView.kt:765)
       at com.fieldbook.tracker.activities.CollectActivity.onOptionsItemSelected(CollectActivity.java:1377)
       at android.app.Activity.onMenuItemSelected(Activity.java:4561)
       at androidx.activity.ComponentActivity.onMenuItemSelected(ComponentActivity.java:528)
       at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:264)
       at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:269)
       at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:110)
       at androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:66)
       at androidx.appcompat.widget.Toolbar$1.onMenuItemClick(Toolbar.java:225)
       at androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:781)
       at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:836)
       at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:159)
       at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:987)
       at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:977)
       at androidx.appcompat.widget.ActionMenuView.invokeItem(ActionMenuView.java:625)
       at androidx.appcompat.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:156)
       at android.view.View.performClick(View.java:7729)
       at android.view.View.performClickInternal(View.java:7706)
       at android.view.View.-$$Nest$mperformClickInternal()
       at android.view.View$PerformClick.run(View.java:30484)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at android.app.ActivityThread.main(ActivityThread.java:8501)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)