Comments you submit will be routed for moderation. If you have an account, please log in first.

Ticket #78 (closed defect: fixed)

Opened 4 years ago

Last modified 18 months ago

uci.changes() doesn't list all changes

Reported by: reporter Owned by:
Priority: major Milestone:
Component: LuCI Base Keywords:
Cc: mss@…

Description (last modified by jow) (diff)

This is probably an issue in the upstream uci (I tried 0.7.5), but for now I have only a luci testcase [*] (attached). I hooked into the Map.uci commit function to do stuff when this happens, I'm especially interested in the changes happening. But only if you press "Save & Apply" or have autoapply set for the model.

But for some reason does the changes() table not contain all data. To try this, use the attached CBI model (guess you know how to do this), go to the page and enter "1" in the Baz field, then click "Add Entry", enter "2", click "Add Entry" and enter "3". Now click "Save & Apply". You lucid's stdout should look like this:

=> changes:                                                                                                                                    
cfg026865.baz=1                                                                                                                                
cfg026865..type=test                                                                                                                           
cfg026865.foo=foo                                                                                                                              
cfg026865.bar=A                                                                                                                                
cfg036865.baz=2                                                                                                                                
cfg036865..type=test                                                                                                                           
cfg036865.foo=foo                                                                                                                              
cfg036865.bar=A                                                                                                                                
cfg046865..type=test                                                                                                                           
cfg046865.foo=foo                                                                                                                              
cfg046865.bar=A                                                                                                                                
=> config:                                                                                                                                     
cfg026865..name=cfg026865                                                                                                                      
cfg026865..type=test                                                                                                                           
cfg026865.baz=1                                                                                                                                
cfg026865.foo=foo                                                                                                                              
cfg026865..index=0                                                                                                                             
cfg026865..anonymous=true                                                                                                                      
cfg026865.bar=A                                                                                                                                
cfg036865..name=cfg036865                                                                                                                      
cfg036865..type=test                                                                                                                           
cfg036865.baz=2
cfg036865.foo=foo
cfg036865..index=1
cfg036865..anonymous=true
cfg036865.bar=A
cfg046865..name=cfg046865
cfg046865..type=test
cfg046865.baz=3
cfg046865.foo=foo
cfg046865..index=2
cfg046865..anonymous=true
cfg046865.bar=A
=> cat:
+testcase.cfg026865=test
testcase.cfg026865.bar=A
testcase.cfg026865.foo=foo
testcase.cfg026865.baz=1
+testcase.cfg036865=test
testcase.cfg036865.bar=A
testcase.cfg036865.foo=foo
testcase.cfg036865.baz=2
+testcase.cfg046865=test
testcase.cfg046865.bar=A
testcase.cfg046865.foo=foo
testcase.cfg046865.baz=3
=> call:
testcase.cfg026865=test
testcase.cfg026865.bar=A
testcase.cfg026865.foo=foo
testcase.cfg026865.baz=1
testcase.cfg036865=test
testcase.cfg036865.bar=A
testcase.cfg036865.foo=foo
testcase.cfg036865.baz=2
testcase.cfg046865=test
testcase.cfg046865.bar=A
testcase.cfg046865.foo=foo
testcase.cfg046865.baz=3
sh: /sbin/luci-reload: not found

Note that there was no baz=3 in the changes output; the config data, the staging dir and the uci command itself do report that value, only changes() misses it (and anything else which wasn't set per default).


[*] I tried to whip up a plain lua testcase but lua fails like this and I'm too tired to debug it:

$ LD_LIBRARY_PATH=./usr/lib LUA_PATH="./usr/lib/lua/?.so" LUA_CPATH="./usr/lib/lua/?.so" lua ../../testcase.lua
lua: error loading module 'uci' from file './usr/lib/lua/uci.so':
        ./usr/lib/lua/uci.so:1: unexpected symbol near 'char(127)'
stack traceback:
        [C]: ?
        [C]: in function 'require'
        ../../testcase.lua:3: in main chunk
        [C]: ?

Attachments

testcase.lua Download (1.3 KB) - added by reporter 4 years ago.
testcase-plain.lua Download (0.6 KB) - added by reporter 4 years ago.
lua-only testcase

Change History

Changed 4 years ago by reporter

Changed 4 years ago by reporter

lua-only testcase

Changed 18 months ago by jow

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)

Add/Change #78 (uci.changes() doesn't list all changes)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.