您现在的位置是: 首页 > 后端开发 Nestedset 出现 Node must exists. 错误解决方案
Nestedset 出现 Node must exists. 错误解决方案
2020-05-20 【后端开发】 1921人已围观 3681次浏览
简介Nestedset 出现 Node must exists. 错误解决方案
在使用Nestedset多级无限分类插件时,保存或修改分类数据时出现Node must exists.报错,通过查看文档发现是左右值数据被污染,需要通过自带的fixTree();方法来进行修复
首先通过
php artisan tinker
打开console控制台
然后执行
MyModel::fixTree();
MyModel对应的就是你自己项目中的Model类。
等待执行完成后,控制台会返回受影响的条目数,这时候再去数据库中查询当前表的数据,就已经是修复成功后的数据。
再次执行分类的增删改就没有问题了
出现此类错误的原因一般是在刚启用Nestedset时,数据库中对应的_lft和_rgt字段数据有问题,或者是直接修改数据库中数据导致的结构树被污染。
执行fixTree() 修复即可
很赞哦! (0)
相关文章
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- PHP 中list()出现Undefined offset: 0错误
- 获取阿里云CDN真实IP
- SqlServer 优化技巧
- 记一次 Mybatis-Plus 自动填充无效问题解决
- start.spring.io访问太慢,构建SpringBoot项目失败
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- SpringBoot 定时任务 多线程
- mac idea spring boot 启动慢
- 删除Git仓库所有历史提交记录,成为一个干净的仓库
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- Debian apt 使用国内镜像
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- nuxt 项目完整部署方案
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
站长推荐
猜你喜欢
- Docker 批量操作命令
- CentOS 安装 Docker
- Redis 提示 MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk 解决方案
- SpringBoot 2.x Security security.basic.enabled=false 失效问题解决
- 迁移 Docker 目录
- LNMP定时备份任务教程(支持排除指定文件夹)
- cmder vim方向键无法使用 解决方案
- 查看MySQL默认读取的配置文件
- LNMP 手动更新 SSL 证书
- 解决Lost connection to MySQL server at 'reading initial communication packet' 的方法