您现在的位置是: 首页 > 后端开发 Nestedset 出现 Node must exists. 错误解决方案
Nestedset 出现 Node must exists. 错误解决方案
2020-05-20 【后端开发】 2341人已围观 5076次浏览
简介Nestedset 出现 Node must exists. 错误解决方案
在使用Nestedset多级无限分类插件时,保存或修改分类数据时出现Node must exists.报错,通过查看文档发现是左右值数据被污染,需要通过自带的fixTree();方法来进行修复
首先通过
php artisan tinker
打开console控制台
然后执行
MyModel::fixTree();
MyModel对应的就是你自己项目中的Model类。
等待执行完成后,控制台会返回受影响的条目数,这时候再去数据库中查询当前表的数据,就已经是修复成功后的数据。
再次执行分类的增删改就没有问题了
出现此类错误的原因一般是在刚启用Nestedset时,数据库中对应的_lft和_rgt字段数据有问题,或者是直接修改数据库中数据导致的结构树被污染。
执行fixTree() 修复即可
很赞哦! (0)
相关文章
- PHP 中list()出现Undefined offset: 0错误
- springboot引入mybatis-plus后出现ClassNotFoundException: org.mybatis.logging.LoggerFactory
- SpringBoot 2.x Security security.basic.enabled=false 失效问题解决
- SpringBoot @NotBlank 不生效问题
- 记一次Java MessageFormat.format踩坑
- start.spring.io访问太慢,构建SpringBoot项目失败
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Laravel项目出现could not be opened: failed to open stream: Permission denied
- 获取阿里云CDN真实IP
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Debian apt 使用国内镜像
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- nuxt 项目完整部署方案
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
站长推荐
猜你喜欢
- SpringBoot 2.x Security security.basic.enabled=false 失效问题解决
- CentOS 安装Node.js
- CentOS 安装 Docker
- Linux no space left on device 出现设备上没有空间问题
- Zookeeper 找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain
- 【Docker】unauthorized: incorrect username or password
- Oracle ORA-12541:TNS:no listener错误解决方法
- Vue 监听回车 el-input 和 input 使用方法不同
- 删除Git仓库所有历史提交记录,成为一个干净的仓库
- 【代码片段】MySQL新建表添加基础字段