您现在的位置是: 首页 > 后端开发 Nestedset 出现 Node must exists. 错误解决方案
Nestedset 出现 Node must exists. 错误解决方案
2020-05-20 【后端开发】 2833人已围观 6102次浏览
简介Nestedset 出现 Node must exists. 错误解决方案
在使用Nestedset多级无限分类插件时,保存或修改分类数据时出现Node must exists.报错,通过查看文档发现是左右值数据被污染,需要通过自带的fixTree();方法来进行修复
首先通过
php artisan tinker
打开console控制台
然后执行
MyModel::fixTree();
MyModel对应的就是你自己项目中的Model类。
等待执行完成后,控制台会返回受影响的条目数,这时候再去数据库中查询当前表的数据,就已经是修复成功后的数据。
再次执行分类的增删改就没有问题了
出现此类错误的原因一般是在刚启用Nestedset时,数据库中对应的_lft和_rgt字段数据有问题,或者是直接修改数据库中数据导致的结构树被污染。
执行fixTree() 修复即可
很赞哦! (0)
相关文章
- mac idea spring boot 启动慢
- start.spring.io访问太慢,构建SpringBoot项目失败
- SqlServer 优化技巧
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- SqlServer字符串处理
- SqlServer 刷新所有视图
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- PHP 中list()出现Undefined offset: 0错误
- PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
- Laravel Dingo/api 出现 The version given was unknown or has no registered routes.报错
点击排行
- 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 自动填充无效问题解决
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- nuxt 项目完整部署方案
站长推荐
猜你喜欢
- CentOS 安装 Docker
- LNMP 手动更新 SSL 证书
- win10 cmd下运行python命令弹出windows应用商店问题
- SqlServer 刷新所有视图
- springboot引入mybatis-plus后出现ClassNotFoundException: org.mybatis.logging.LoggerFactory
- ElasticSearch安装踩坑指南
- win10 cmder Debian 安装配置 oh-my-zsh
- Vue 报错 Avoid using non-primitive value as key, use string/number value instead
- idea去掉Smart commands execution提示
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance